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

[Question] OSError: [WinError 127], after 'import gym' #2720

Closed
whliu90 opened this issue Mar 30, 2022 · 5 comments
Closed

[Question] OSError: [WinError 127], after 'import gym' #2720

whliu90 opened this issue Mar 30, 2022 · 5 comments

Comments

@whliu90
Copy link

whliu90 commented Mar 30, 2022

Question

About my installation:
>> git clone https://github.com/openai/gym.git
then changed my directory and installed gym:
>> pip install -e .[all]
It seems everything was OK.

However, it gives me WinError 127, when trying to import gym.
>>> import gym

Traceback (most recent call last):
File "", line 1, in
File "c:\users\whliu\desktop\gym\gym_init_.py", line 12, in
from gym.envs import make, spec, register
File "c:\users\whliu\desktop\gym\gym\envs_init_.py", line 10, in
load_env_plugins()
File "c:\users\whliu\desktop\gym\gym\envs\registration.py", line 725, in load

env_plugins
fn = plugin.load()
File "C:\Users\whliu.conda\envs\rl\lib\site-packages\importlib_metadata_ini
t
_.py", line 203, in load
module = import_module(match.group('module'))
File "C:\Users\whliu.conda\envs\rl\lib\importlib_init_.py", line 127, in i
mport_module
return _bootstrap.gcd_import(name[level:], package, level)
File "C:\Users\whliu.conda\envs\rl\lib\site-packages\ale_py_init
.py", lin
e 26, in
os.add_dll_directory(packagedir)
File "C:\Users\whliu.conda\envs\rl\lib\os.py", line 1109, in add_dll_director
y
cookie = nt._add_dll_directory(path)
OSError: [WinError 127] 找不到指定的程序。: 'C:\Users\whliu\.conda\envs\rl
\lib\site-packages\ale_py'

  • python 3.8.8
  • mujoco 1.50.1
  • win 10
@whliu90 whliu90 changed the title [Question] OSError: [WinError 127], After 'import gym' [Question] OSError: [WinError 127], after 'import gym' Mar 30, 2022
@jkterry1
Copy link
Collaborator

@pseudo-rnd-thoughts would you mind taking a quick look at this?

@pseudo-rnd-thoughts
Copy link
Contributor

Im not able to replicate your issue as mujoco is deprecated on windows for the latest branch
However, looking at the error then it appears to be ale-py

But I think that the issue if with using editable in installing it
#2648 (comment)
See this issue that explains the problem with editable for ale-py

Does pip install gym[atari] fix it?

@whliu90
Copy link
Author

whliu90 commented Apr 2, 2022

Im not able to replicate your issue as mujoco is deprecated on windows for the latest branch However, looking at the error then it appears to be ale-py

But I think that the issue if with using editable in installing it #2648 (comment) See this issue that explains the problem with editable for ale-py

Does pip install gym[atari] fix it?

Thanks for your advice. I just fix it by running pip uninstall ale-py, then everything is OK right now. I'm not sure if this would brings any bad influcence.

@pseudo-rnd-thoughts
Copy link
Contributor

No worries, is this fixed? If so, could you close it

@whliu90 whliu90 closed this as completed Apr 2, 2022
@whliu90
Copy link
Author

whliu90 commented Apr 2, 2022

Yes, it is fixed. Thanks again for your help.

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

3 participants