meshcat-dev / meshcat-python

WebGL-based 3D visualizer for Python
MIT License
258 stars 63 forks source link

Meshcat does not work when debugging in VSCode #95

Open lucasrm25 opened 3 years ago

lucasrm25 commented 3 years ago

Running Meshcat in debug mode in VSCode:

import meshcat
vis = meshcat.Visualizer()

results the following error:

unknown option --module
usage: /home/q513234/anaconda3/envs/main/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

Traceback (most recent call last):
  File "/home/q513234/.vscode/extensions/ms-python.python-2021.2.633441544/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vars.py", line 416, in evaluate_expression
    compiled = compile(_expression_to_evaluate(expression), '<string>', 'eval')
  File "<string>", line 1
    vis = meshcat.Visualizer()
        ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/q513234/anaconda3/envs/main/lib/python3.8/site-packages/meshcat/visualizer.py", line 78, in __init__
    self.window = ViewerWindow(zmq_url=zmq_url, start_server=(zmq_url is None), server_args=server_args)
  File "/home/q513234/anaconda3/envs/main/lib/python3.8/site-packages/meshcat/visualizer.py", line 17, in __init__
    self.server_proc, self.zmq_url, self.web_url = start_zmq_server_as_subprocess(
  File "/home/q513234/anaconda3/envs/main/lib/python3.8/site-packages/meshcat/servers/zmqserver.py", line 69, in start_zmq_server_as_subprocess
    raise RuntimeError("the meshcat server process exited prematurely with exit code " + str(server_proc.poll()))
RuntimeError: the meshcat server process exited prematurely with exit code 2

does anyone has an idea, what could be causing this problem?

My VScode configuration:

Version: 1.53.1 Commit: 5d424b828ada08e1eb9f95d6cb41120234ef57c7 Date: 2021-02-08T23:30:54.166Z Electron: 11.2.1 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Linux x64 5.8.0-41-generic