I have the minimal install of the packaged version using pip3(Python3.6).
Next I want to install the full set of environments, however there are some errors:
β gym git:(master) sudo python3.6 -m pip install 'gym[all]'
The directory '/home/leonardo/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/leonardo/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: gym[all] in /home/leonardo/Software/gym (0.10.5)
Requirement already satisfied: numpy>=1.10.4 in /home/leonardo/.local/lib/python3.6/site-packages (from gym[all]) (1.14.3)
Requirement already satisfied: requests>=2.0 in /usr/lib/python3/dist-packages (from gym[all]) (2.9.1)
Requirement already satisfied: six in /home/leonardo/.local/lib/python3.6/site-packages (from gym[all]) (1.11.0)
Requirement already satisfied: pyglet>=1.2.0 in /usr/local/lib/python3.6/dist-packages (from gym[all]) (1.3.2)
Requirement already satisfied: atari_py>=0.1.1 in /usr/local/lib/python3.6/dist-packages (from gym[all]) (0.1.1)
Requirement already satisfied: Pillow in /usr/local/lib/python3.6/dist-packages (from gym[all]) (5.1.0)
Requirement already satisfied: PyOpenGL in /usr/local/lib/python3.6/dist-packages (from gym[all]) (3.1.0)
Collecting Box2D-kengz (from gym[all])
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/81/20/51d6c0c87f7642efb709c518fb0ca8e5eab068259588552c41da5926ae27/Box2D-kengz-2.3.3.tar.gz (425kB)
100% |ββββββββββββββββββββββββββββββββ| 430kB 1.5MB/s
Requirement already satisfied: mujoco_py>=1.50 in /usr/local/lib/python3.6/dist-packages (from gym[all]) (1.50.1.56)
Requirement already satisfied: imageio in /usr/local/lib/python3.6/dist-packages (from gym[all]) (2.3.0)
Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from pyglet>=1.2.0->gym[all]) (0.16.0)
Requirement already satisfied: cffi>=1.10 in /usr/local/lib/python3.6/dist-packages (from mujoco_py>=1.50->gym[all]) (1.11.5)
Requirement already satisfied: Cython>=0.27.2 in /usr/local/lib/python3.6/dist-packages (from mujoco_py>=1.50->gym[all]) (0.28.2)
Requirement already satisfied: glfw>=1.4.0 in /usr/local/lib/python3.6/dist-packages (from mujoco_py>=1.50->gym[all]) (1.6.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.6/dist-packages (from cffi>=1.10->mujoco_py>=1.50->gym[all]) (2.18)
Installing collected packages: Box2D-kengz
Running setup.py install for Box2D-kengz ... error
Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-0dyjdqz5/Box2D-kengz/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-jj55obxs/install-record.txt --single-version-externally-managed --compile:
Using setuptools (version 20.7.0).
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/Box2D
copying library/Box2D/__init__.py -> build/lib.linux-x86_64-3.6/Box2D
copying library/Box2D/Box2D.py -> build/lib.linux-x86_64-3.6/Box2D
creating build/lib.linux-x86_64-3.6/Box2D/b2
copying library/Box2D/b2/__init__.py -> build/lib.linux-x86_64-3.6/Box2D/b2
running build_ext
building 'Box2D._Box2D' extension
swigging Box2D/Box2D.i to Box2D/Box2D_wrap.cpp
swig -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
Box2D/Common/b2Math.h:67: Warning 302: Identifier 'b2Vec2' redefined by %extend (ignored),
Box2D/Box2D_math.i:47: Warning 302: %extend definition of 'b2Vec2'.
Box2D/Common/b2Math.h:158: Warning 302: Identifier 'b2Vec3' redefined by %extend (ignored),
Box2D/Box2D_math.i:168: Warning 302: %extend definition of 'b2Vec3'.
Box2D/Common/b2Math.h:197: Warning 302: Identifier 'b2Mat22' redefined by %extend (ignored),
Box2D/Box2D_math.i:301: Warning 302: %extend definition of 'b2Mat22'.
Box2D/Common/b2Math.h:271: Warning 302: Identifier 'b2Mat33' redefined by %extend (ignored),
Box2D/Box2D_math.i:372: Warning 302: %extend definition of 'b2Mat33'.
Box2D/Collision/b2DynamicTree.h:44: Warning 312: Nested union not currently supported (ignored).
Box2D/Common/b2Settings.h:144: Warning 506: Can't wrap varargs with keyword arguments enabled
Box2D/Common/b2Math.h:91: Warning 509: Overloaded method b2Vec2::operator ()(int32) effectively ignored,
Box2D/Common/b2Math.h:85: Warning 509: as it is shadowed by b2Vec2::operator ()(int32) const.
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/Box2D
creating build/temp.linux-x86_64-3.6/Box2D/Dynamics
creating build/temp.linux-x86_64-3.6/Box2D/Dynamics/Contacts
creating build/temp.linux-x86_64-3.6/Box2D/Dynamics/Joints
creating build/temp.linux-x86_64-3.6/Box2D/Common
creating build/temp.linux-x86_64-3.6/Box2D/Collision
creating build/temp.linux-x86_64-3.6/Box2D/Collision/Shapes
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c Box2D/Box2D_wrap.cpp -o build/temp.linux-x86_64-3.6/Box2D/Box2D_wrap.o -I. -Wno-unused
cc1plus: warning: command line option β-Wstrict-prototypesβ is valid for C/ObjC but not for C++
Box2D/Box2D_wrap.cpp:173:21: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-
0dyjdqz5/Box2D-kengz/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-jj55obxs/install-
record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-
0dyjdqz5/Box2D-kengz/
What should I do to fix this error?
Thanks!
If you are using Debian/Ubuntu+Python 3, you need to try this: $ sudo apt-get install python3-dev
Reference:
https://www.cyberciti.biz/faq/debian-ubuntu-linux-python-h-file-not-found-error-solution/
https://stackoverflow.com/questions/26053982/setup-script-exited-with-error-command-x86-64-linux-gnu-gcc-failed-with-exit
this should be fixed now with usage of box2d-py
For python 3.7 you need to run : sudo apt-get install python3.7-dev
Most helpful comment
If you are using Debian/Ubuntu+Python 3, you need to try this:
$ sudo apt-get install python3-devReference:
https://www.cyberciti.biz/faq/debian-ubuntu-linux-python-h-file-not-found-error-solution/
https://stackoverflow.com/questions/26053982/setup-script-exited-with-error-command-x86-64-linux-gnu-gcc-failed-with-exit