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

Unable to install gym #849

Closed
HenryZhou7 opened this issue Jan 30, 2018 · 9 comments
Closed

Unable to install gym #849

HenryZhou7 opened this issue Jan 30, 2018 · 9 comments
Labels

Comments

@HenryZhou7
Copy link

The command I tried to run is

pip install gym[all]

And it gave me the following output

$ pip install gym[all]
Collecting gym[all]
  Using cached gym-0.9.6.tar.gz
Requirement already satisfied: numpy>=1.10.4 in .../python2.7/site-packages (from gym[all])
Requirement already satisfied: requests>=2.0 in .../python2.7/site-packages (from gym[all])
Requirement already satisfied: six in .../python2.7/site-packages (from gym[all])
Requirement already satisfied: pyglet>=1.2.0 in .../python2.7/site-packages (from gym[all])
Requirement already satisfied: Box2D-kengz in .../python2.7/site-packages (from gym[all])
Requirement already satisfied: PyOpenGL in .../python2.7/site-packages (from gym[all])
Requirement already satisfied: atari_py>=0.1.1 in .../python2.7/site-packages (from gym[all])
Requirement already satisfied: Pillow in .../python2.7/site-packages (from gym[all])
Collecting mujoco_py>=1.50 (from gym[all])
  Using cached mujoco-py-1.50.1.34.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-14edRC/mujoco-py/setup.py", line 2, in <module>
        import importlib.util
    ImportError: No module named util
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-14edRC/mujoco-py/

Can someone help me right here?

@hengyuan-hu
Copy link

try to use python3 and pip3 install. The importlib in python2 seems not compatible

@HenryZhou7
Copy link
Author

Thanks!

I tried with a python3.6 anaconda environment and can bypass that stage. However there is still error saying

The C compiler "/usr/bin/cc" is not able to compile a simple test program.
  
    It fails with the following output:
  
     Change Dir: /var/tmp/pip-build-9z2q4qq1/pachi-py/pachi_py/build/CMakeFiles/CMakeTmp
...
...
...
fatal error: error closing /tmp/ccFI003w.s: No space left on device

It says that there is no space left on device. But there are still hundreds of GBs on my mounted disk. What could be causing this problem? Thanks!

@hengyuan-hu
Copy link

I cannot reproduce this error. In fact, when I try pip3 install gym[all], the installation just hangs at the mujoco installation step. Normally I develop RL stuff in linux and don't use conda so I am not very familiar with this issue.

This problem seems like a permission or system issue. You may want to search online for solution.

@Accessant
Copy link

Accessant commented Jan 31, 2018

Try a pip install gym without the [all]. You need a license for mujoco which costs $500. Forget mujoco. Also note: the newest version of gym got rid of the benchmarks functions, which universe uses. Wait for universe update or install 0.9.5.

https://alliseesolutions.wordpress.com/2016/12/08/openai-universe-installation-guide-ubuntu-16-04/ can be helpful.

@simon-zy
Copy link

I used pip3 to install, but I just got stuck at the mujoco-py1.50 installation.I don't know where the problem is.

@Accessant
Copy link

Accessant commented Mar 23, 2018 via email

@nofreewill42
Copy link

I get same error running this:
git clone https://github.com/openai/gym.git
cd gym
sudo pip3 install -e '.[all]'

How do I ignore mujoco?

@Sandy4321
Copy link

please with this problem for windows 10
error is:
E:\WINPYTHON_FULL_apr22\WPy64-3770\scripts>pip install gym[all]
Requirement already satisfied: gym[all] in e:\winpython_full_apr22\wpy64-3770\python-3.7.7.amd64\lib\site-packages (0.17.1)
Requirement already satisfied: numpy>=1.10.4 in e:\winpython_full_apr22\wpy64-3770\python-3.7.7.amd64\lib\site-packages (from gym[all]) (1.18.2+mkl)
Requirement already satisfied: cloudpickle<1.4.0,>=1.2.0 in e:\winpython_full_apr22\wpy64-3770\python-3.7.7.amd64\lib\site-packages (from gym[all]) (1.3.0)
Requirement already satisfied: scipy in e:\winpython_full_apr22\wpy64-3770\python-3.7.7.amd64\lib\site-packages (from gym[all]) (1.4.1)
Requirement already satisfied: pyglet<=1.5.0,>=1.4.0 in e:\winpython_full_apr22\wpy64-3770\python-3.7.7.amd64\lib\site-packages (from gym[all]) (1.5.0)
Requirement already satisfied: six in e:\winpython_full_apr22\wpy64-3770\python-3.7.7.amd64\lib\site-packages (from gym[all]) (1.14.0)
Collecting atari-py~=0.2.0; extra == "all"
Downloading atari_py-0.2.6-cp37-cp37m-win_amd64.whl (1.8 MB)
|████████████████████████████████| 1.8 MB 656 kB/s
Collecting mujoco-py<2.0,>=1.50; extra == "all"
Downloading mujoco-py-1.50.1.68.tar.gz (120 kB)
|████████████████████████████████| 120 kB 6.8 MB/s
Collecting box2d-py~=2.3.5; extra == "all"
Downloading box2d-py-2.3.8.tar.gz (374 kB)
|████████████████████████████████| 374 kB ...
Requirement already satisfied: imageio; extra == "all" in e:\winpython_full_apr22\wpy64-3770\python-3.7.7.amd64\lib\site-packages (from gym[all]) (2.8.0)
Requirement already satisfied: Pillow; extra == "all" in e:\winpython_full_apr22\wpy64-3770\python-3.7.7.amd64\lib\site-packages (from gym[all]) (7.0.0)
Collecting opencv-python; extra == "all"
Downloading opencv_python-4.2.0.34-cp37-cp37m-win_amd64.whl (33.0 MB)
|████████████████████████████████| 33.0 MB 819 kB/s
Requirement already satisfied: future in e:\winpython_full_apr22\wpy64-3770\python-3.7.7.amd64\lib\site-packages (from pyglet<=1.5.0,>=1.4.0->gym[all]) (0.18.2)
Collecting glfw>=1.4.0
Downloading glfw-1.11.0-py2.py27.py3.py30.py31.py32.py33.py34.py35.py36.py37.py38-none-win_amd64.whl (492 kB)
|████████████████████████████████| 492 kB 3.3 MB/s
Requirement already satisfied: Cython>=0.27.2 in e:\winpython_full_apr22\wpy64-3770\python-3.7.7.amd64\lib\site-packages (from mujoco-py<2.0,>=1.50; extra == "all"->gym[all]) (0.29.15)
Requirement already satisfied: cffi>=1.10 in e:\winpython_full_apr22\wpy64-3770\python-3.7.7.amd64\lib\site-packages (from mujoco-py<2.0,>=1.50; extra == "all"->gym[all]) (1.14.0)
Collecting lockfile>=0.12.2
Downloading lockfile-0.12.2-py2.py3-none-any.whl (13 kB)
Requirement already satisfied: pycparser in e:\winpython_full_apr22\wpy64-3770\python-3.7.7.amd64\lib\site-packages (from cffi>=1.10->mujoco-py<2.0,>=1.50; extra == "all"->gym[all]) (2.20)
Building wheels for collected packages: mujoco-py, box2d-py
Building wheel for mujoco-py (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\setup.py'"'"'; file='"'"'C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\sndr\AppData\Local\Temp\pip-wheel-5jiwopt6'
cwd: C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py
Complete output (27 lines):
running bdist_wheel
running build
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\setup.py", line 44, in
tests_require=read_requirements_file('requirements.dev.txt'),
File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\site-packages\setuptools_init_.py", line 144, in setup
return distutils.core.setup(**attrs)
File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
self.run_command('build')
File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\setup.py", line 28, in run
import mujoco_py # noqa: force build
File "C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\mujoco_py_init_.py", line 3, in
from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
File "C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\mujoco_py\builder.py", line 20, in
from lockfile import LockFile
ModuleNotFoundError: No module named 'lockfile'

ERROR: Failed building wheel for mujoco-py
Running setup.py clean for mujoco-py
Building wheel for box2d-py (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\box2d-py\setup.py'"'"'; file='"'"'C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\box2d-py\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\sndr\AppData\Local\Temp\pip-wheel-lrgkhbru'
cwd: C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\box2d-py
Complete output (16 lines):
Using setuptools (version 46.0.0).
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\Box2D
copying library\Box2D\Box2D.py -> build\lib.win-amd64-3.7\Box2D
copying library\Box2D_init_.py -> build\lib.win-amd64-3.7\Box2D
creating build\lib.win-amd64-3.7\Box2D\b2
copying library\Box2D\b2_init_.py -> build\lib.win-amd64-3.7\Box2D\b2
running build_ext
building 'Box2D._Box2D' extension
swigging Box2D\Box2D.i to Box2D\Box2D_wrap.cpp
swig.exe -python -c++ -IBox2D -small -O -includeall -ignoremissing -w201 -globals b2Globals -outdir library\Box2D -keyword -w511 -D_SWIG_KWARGS -o Box2D\Box2D_wrap.cpp Box2D\Box2D.i
error: command 'swig.exe' failed: No such file or directory

ERROR: Failed building wheel for box2d-py
Running setup.py clean for box2d-py
Failed to build mujoco-py box2d-py
Installing collected packages: atari-py, glfw, lockfile, mujoco-py, box2d-py, opencv-python
Running setup.py install for mujoco-py ... error
ERROR: Command errored out with exit status 1:
command: 'E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\setup.py'"'"'; file='"'"'C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\sndr\AppData\Local\Temp\pip-record-iavd20ki\install-record.txt' --single-version-externally-managed --compile --install-headers 'E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\Include\mujoco-py'
cwd: C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py
Complete output (56 lines):
running install
running build

You appear to be missing MuJoCo.  We expected to find the file here: E:\WINPYTHON_FULL_apr22\WPy64-3770\settings\.mujoco\mjpro150

This package only provides python bindings, the library must be installed separately.

Please follow the instructions on the README to install MuJoCo

    https://github.com/openai/mujoco-py#install-mujoco

Which can be downloaded from the website

    https://www.roboti.us/index.html

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\setup.py", line 44, in <module>
    tests_require=read_requirements_file('requirements.dev.txt'),
  File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\site-packages\setuptools\__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\site-packages\setuptools\command\install.py", line 61, in run
    return orig.install.run(self)
  File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\distutils\command\install.py", line 545, in run
    self.run_command('build')
  File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\setup.py", line 28, in run
    import mujoco_py  # noqa: force build
  File "C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\mujoco_py\__init__.py", line 3, in <module>
    from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
  File "C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\mujoco_py\builder.py", line 502, in <module>
    mjpro_path, key_path = discover_mujoco()
  File "C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\mujoco_py\utils.py", line 93, in discover_mujoco
    raise Exception(message)
Exception:
You appear to be missing MuJoCo.  We expected to find the file here: E:\WINPYTHON_FULL_apr22\WPy64-3770\settings\.mujoco\mjpro150

This package only provides python bindings, the library must be installed separately.

Please follow the instructions on the README to install MuJoCo

    https://github.com/openai/mujoco-py#install-mujoco

Which can be downloaded from the website

    https://www.roboti.us/index.html

----------------------------------------

ERROR: Command errored out with exit status 1: 'E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\setup.py'"'"'; file='"'"'C:\Users\sndr\AppData\Local\Temp\pip-install-sql0jwqj\mujoco-py\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\sndr\AppData\Local\Temp\pip-record-iavd20ki\install-record.txt' --single-version-externally-managed --compile --install-headers 'E:\WINPYTHON_FULL_apr22\WPy64-3770\python-3.7.7.amd64\Include\mujoco-py' Check the logs for full command output.

E:\WINPYTHON_FULL_apr22\WPy64-3770\scripts>

@jkterry1
Copy link
Collaborator

PR #2762 is about to be merged, introducing V4 MuJoCo environments using new bindings and a dramatically newer version of the engine. If this issue still persists with the V4 ones, please create a new issue for it.

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

No branches or pull requests

8 participants