Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Only) when importing in debug mode: name 'raw_input' is not defined #544

Closed
famura opened this issue Jun 8, 2020 · 6 comments
Closed

Comments

@famura
Copy link

famura commented Jun 8, 2020

Describe the bug
When I run import mujoco_py using the debugger in CLion (v2020.1.2, but also with a pervious version), the program chrashed with the error message below. Running this script works perfectly fine.

To Reproduce
Set up a system as descibed below (For me Python 3.8 is decisive here), a debugger, and try importing the module.

Expected behavior
Same behavior as for running the py-file without a debugger.

Error Messages

pydev debugger: process 21411 is connecting
Connected to pydev debugger (build 201.7846.88)
Traceback (most recent call last):
  File "<string>", line 25, in <module>
NameError: name 'raw_input' is not defined

Desktop (please complete the following information):

  • OS: [Ubuntu 18.04]
  • Python Version [3.8.3]
  • Mujoco Version [2.0]
  • mujoco-py version [2.0.2.10]

Environment

  • output of: echo $LD_LIBRARY_PATH
    /home/$USER/.mujoco/mujoco200/bin

Additional Information
I tried all possible settings of "PyQt compatible" in the IDE's settings. It didn't make a difference.

When I use pdb from console, importing mujoco_py takes so long that I never waited untill it finished.

@HosikChae
Copy link

HosikChae commented Sep 26, 2020

Same here. I am running on PyCharm on macOS 10.15.6, and I meet two raw_input errors in a row only when debugging.
I tracked down along its import chain, and it seems the errors occur when loading some related cython extensions.

The errors are happening at loader.load_module() (line 124) after loader = ExtensionFileLoader(name, path)
called by mod = load_dynamic_ext('cymj', cext_so_path) (line 101)
called by cymj = load_cython_ext(mjpro_path) (line 503) in mujoco_py/builder.py
when loading cymj from mujoco_py/generated/cymj_1.50.1.68_38_macextensionbuilder_38.so.

By the way, I am using mujoco-py through gym, it is referring to ~/.mujoco/mjpro150.

I hope this info would be helpful to fix the issue.

@Jendker
Copy link

Jendker commented Oct 22, 2020

Same issue here. Makes the debugging very difficult if one is using mujoco with python 3.8.

@gauthamvasan
Copy link

I had the same issue. I temporarily sidestepped the issue by switching to python 3.7. Debugger works on pycharm if I use my conda env with python 3.7

@Peter-zds
Copy link

I had the same issue. I temporarily sidestepped the issue by switching to python 3.7. Debugger works on pycharm if I use my conda env with python 3.7

Thanks

@PeterMitrano
Copy link

FWIW, turning off "attach to subprocesses" fixes this problem for me. See:
https://www.jetbrains.com/help/pycharm/debugger-python.html
https://youtrack.jetbrains.com/issue/PY-44481

@famura famura closed this as completed Nov 20, 2021
@nopaddleboat
Copy link

I have the same issue in vscode. As suggested by @PeterMitrano I added ""subProcess": false," to vscode launch file, problem solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants