Skip to content

Commit 3caf125

Browse files
committed
better low level handling of missing python installation
1 parent 90bfdf7 commit 3caf125

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

wolframclient/cli/commands/start_externalevaluate.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
from __future__ import absolute_import, print_function, unicode_literals
22

33
import os
4+
import sys
45

56
from wolframclient.cli.utils import SimpleCommand
67
from wolframclient.utils.api import externalevaluate as ev
8+
from wolframclient.utils.api import zmq
79

810

911
class Command(SimpleCommand):
@@ -19,4 +21,11 @@ def handle(self, port=None, installpath=None, **opts):
1921
if installpath:
2022
os.environ["WOLFRAM_INSTALLATION_DIRECTORY"] = installpath
2123

24+
try:
25+
zmq.Context
26+
except ImportError as e:
27+
print("%s. Please install zmq. https://zeromq.org/languages/python/" % e, file=sys.stderr)
28+
sys.stderr.flush()
29+
sys.exit(1)
30+
2231
ev.start_zmq_loop(port=port)

0 commit comments

Comments
 (0)