Gym: Unable to install Atari on MacOS

Created on 16 Apr 2018  路  7Comments  路  Source: openai/gym

I am trying to install Atari on my MacOS using the command
pip install "gym[atari]"
However, it fails throwing the below error.

Could anyone give any leads as to what I might be doing wrong?

Requirement already satisfied: numpy>=1.10.4 in /Users/jeet/anaconda/lib/python3.6/site-packages (from gym[atari])
Requirement already satisfied: requests>=2.0 in /Users/jeet/anaconda/lib/python3.6/site-packages (from gym[atari])
Requirement already satisfied: six in /Users/jeet/anaconda/lib/python3.6/site-packages (from gym[atari])
Requirement already satisfied: pyglet>=1.2.0 in /Users/jeet/anaconda/lib/python3.6/site-packages (from gym[atari])
Collecting atari_py>=0.1.1 (from gym[atari])
Downloading https://files.pythonhosted.org/packages/8b/38/3c6716ac9031a686cc3228f3855e48c08a40e4d7c490dd4c21c65b465205/atari-py-0.1.1.tar.gz (760kB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 768kB 967kB/s
Requirement already satisfied: Pillow in /Users/jeet/anaconda/lib/python3.6/site-packages (from gym[atari])
Collecting PyOpenGL (from gym[atari])
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/jeet/anaconda/lib/python3.6/site-packages (from requests>=2.0->gym[atari])
Requirement already satisfied: certifi>=2017.4.17 in /Users/jeet/anaconda/lib/python3.6/site-packages (from requests>=2.0->gym[atari])
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /Users/jeet/anaconda/lib/python3.6/site-packages (from requests>=2.0->gym[atari])
Requirement already satisfied: idna<2.7,>=2.5 in /Users/jeet/anaconda/lib/python3.6/site-packages (from requests>=2.0->gym[atari])
Requirement already satisfied: future in /Users/jeet/anaconda/lib/python3.6/site-packages (from pyglet>=1.2.0->gym[atari])
Requirement already satisfied: olefile in /Users/jeet/anaconda/lib/python3.6/site-packages (from Pillow->gym[atari])
Building wheels for collected packages: atari-py
Running setup.py bdist_wheel for atari-py ... error
Complete output from command /Users/jeet/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/lk/5r2vz74976nd2884sn5y8nc00000gn/T/pip-build-50c38m0f/atari-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 /var/folders/lk/5r2vz74976nd2884sn5y8nc00000gn/T/tmpecqtutsopip-wheel- --python-tag cp36:
running bdist_wheel
running build
mkdir -p build && cd build && cmake .. && make -j4
/bin/sh: cmake: command not found
make: * [build] Error 127
Could not build atari-py: Command '['make', 'build', '-C', 'atari_py/ale_interface', '-j', '3']' returned non-zero exit status 2.. (HINT: are you sure cmake is installed? You might also be missing a library. Atari-py requires: zlib [installable as 'apt-get install zlib1g-dev' on Ubuntu].)
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/lk/5r2vz74976nd2884sn5y8nc00000gn/T/pip-build-50c38m0f/atari-py/setup.py", line 36, in
tests_require=['nose2']
File "/Users/jeet/anaconda/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/jeet/anaconda/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Users/jeet/anaconda/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/jeet/anaconda/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 179, in run
self.run_command('build')
File "/Users/jeet/anaconda/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/jeet/anaconda/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/private/var/folders/lk/5r2vz74976nd2884sn5y8nc00000gn/T/pip-build-50c38m0f/atari-py/setup.py", line 16, in run
subprocess.check_call(cmd)
File "/Users/jeet/anaconda/lib/python3.6/subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', 'build', '-C', 'atari_py/ale_interface', '-j', '3']' returned non-zero exit status 2.


Failed building wheel for atari-py
Running setup.py clean for atari-py
Failed to build atari-py
Installing collected packages: atari-py, PyOpenGL
Running setup.py install for atari-py ... error
Complete output from command /Users/jeet/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/lk/5r2vz74976nd2884sn5y8nc00000gn/T/pip-build-50c38m0f/atari-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 /var/folders/lk/5r2vz74976nd2884sn5y8nc00000gn/T/pip-1g_i3xhw-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
mkdir -p build && cd build && cmake .. && make -j4
/bin/sh: cmake: command not found
make: * [build] Error 127
Could not build atari-py: Command '['make', 'build', '-C', 'atari_py/ale_interface', '-j', '3']' returned non-zero exit status 2.. (HINT: are you sure cmake is installed? You might also be missing a library. Atari-py requires: zlib [installable as 'apt-get install zlib1g-dev' on Ubuntu].)
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/lk/5r2vz74976nd2884sn5y8nc00000gn/T/pip-build-50c38m0f/atari-py/setup.py", line 36, in
tests_require=['nose2']
File "/Users/jeet/anaconda/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/jeet/anaconda/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Users/jeet/anaconda/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/jeet/anaconda/lib/python3.6/site-packages/setuptools-27.2.0-py3.6.egg/setuptools/command/install.py", line 61, in run
File "/Users/jeet/anaconda/lib/python3.6/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/Users/jeet/anaconda/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/jeet/anaconda/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/private/var/folders/lk/5r2vz74976nd2884sn5y8nc00000gn/T/pip-build-50c38m0f/atari-py/setup.py", line 16, in run
subprocess.check_call(cmd)
File "/Users/jeet/anaconda/lib/python3.6/subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', 'build', '-C', 'atari_py/ale_interface', '-j', '3']' returned non-zero exit status 2.

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

Command "/Users/jeet/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/lk/5r2vz74976nd2884sn5y8nc00000gn/T/pip-buucild-50c38m0f/atari-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 /var/folders/lk/5r2vz74976nd2884sn5y8nc00000gn/T/pip-1g_i3xhw-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/lk/5r2vz74976nd2884sn5y8nc00000gn/T/pip-build-50c38m0f/atari-py/

Most helpful comment

I had the same error and then after reading mine as well as your error message, HINT: are you sure cmake is installed? You might also be missing a library., you need to install cmake first. Doing this fixed my problem.

All 7 comments

me neither, Ubuntu 17.10

I am having the same issue on MacOS

I fixed it by reinstalling

sudo apt-get install -y python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig
git clone https://github.com/openai/gym
cd gym
pip install -e .[all]

I had the same error and then after reading mine as well as your error message, HINT: are you sure cmake is installed? You might also be missing a library., you need to install cmake first. Doing this fixed my problem.

https://stackoverflow.com/questions/32185079/installing-cmake-with-home-brew
You can use brew install cmake

(This ticket can be closed)

I Have cmake and the same problem persist

The original error is caused by the user now having cmake installed /bin/sh: cmake: command not found. Please file a new issue if you have a different issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tylerlekang picture tylerlekang  路  3Comments

mdavis-xyz picture mdavis-xyz  路  3Comments

pdoongarwal picture pdoongarwal  路  4Comments

RuofanKong picture RuofanKong  路  4Comments

Spiral-Galaxy picture Spiral-Galaxy  路  3Comments