Reputation: 193
I installed and deployed the gym on the centos6.5 system. The following is the installation process.
Wget --no-check-certificate https://repo.anaconda.com/archive/Anaconda3-5.1.0-Linux-x86_64.sh
Create a virtual environment Conda create --name gymlab python=3.6
Install gym Source activate gym Git clone https://github.com/openai/gym.git Cd gym Pip install '.[all]'
Run "pip install '.[all]' "The last step, reported the following error: Processing /root/gym Requirement already satisfied: numpy>=1.10.4 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages (from gym==0.10.5) (1.14.3) Requirement already satisfied: requests>=2.0 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages (from gym==0.10.5) (2.18.4) Requirement already satisfied: six in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages (from gym==0.10.5) (1.11.0) Requirement already satisfied: pyglet>=1.2.0 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages (from gym==0.10.5) (1.3.2) Requirement already satisfied: atari_py>=0.1.1 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages (from gym==0.10.5) (0.1.1) Requirement already satisfied: Pillow in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages (from gym==0.10.5) (5.1.0) Requirement already satisfied: PyOpenGL in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages (from gym==0.10.5) (3.1.0) Collecting Box2D-kengz (from gym==0.10.5) Using cached https://files.pythonhosted.org/packages/81/20/51d6c0c87f7642efb709c518fb0ca8e5eab068259588552c41da5926ae27/Box2D-kengz-2.3.3.tar.gz Collecting mujoco_py>=1.50 (from gym==0.10.5) Collecting imageio (from gym==0.10.5) Using cached https://files.pythonhosted.org/packages/a7/1d/33c8686072148b3b0fcc12a2e0857dd8316b8ae20a0fa66c8d6a6d01c05c/imageio-2.3.0-py2.py3-none-any.whl Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages (from requests>=2.0->gym==0.10.5) (3.0.4) Requirement already satisfied: certifi>=2017.4.17 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages (from requests>=2.0->gym==0.10.5) (2018.4.16) Requirement already satisfied: idna<2.7,>=2.5 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages (from requests>=2.0->gym==0.10.5) (2.6) Requirement already satisfied: urllib3<1.23,>=1.21.1 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages (from requests>=2.0->gym==0.10.5) (1.22) Requirement already satisfied: future in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages (from pyglet>=1.2.0->gym==0.10.5) (0.16.0) Collecting glfw>=1.4.0 (from mujoco_py>=1.50->gym==0.10.5) Collecting cffi>=1.10 (from mujoco_py>=1.50->gym==0.10.5) Using cached https://files.pythonhosted.org/packages/6d/c0/47db8f624f3e4e2f3f27be03a93379d1ba16a1450a7b1aacfa0366e2c0dd/cffi-1.11.5-cp36-cp36m-manylinux1_x86_64.whl Collecting Cython>=0.27.2 (from mujoco_py>=1.50->gym==0.10.5) Using cached https://files.pythonhosted.org/packages/19/eb/c4d9f3beafd5ac0615936860bcee41d93ca58f8734a16715da0037d2c468/Cython-0.28.2-cp36-cp36m-manylinux1_x86_64.whl Collecting pycparser (from cffi>=1.10->mujoco_py>=1.50->gym==0.10.5) Building wheels for collected packages: gym, Box2D-kengz Running setup.py bdist_wheel for gym ... done Stored in directory: /tmp/pip-ephem-wheel-cache-or4iim1z/wheels/6e/18/10/1234738b0aafab3f8f70d61d2763dc3efda78a41d153584dee Running setup.py bdist_wheel for Box2D-kengz ... error Complete output from command /root/anaconda3/envs/gymlab/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-5jh8n6q7/Box2D-kengz/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 /tmp/pip-wheel-ckydr3cn --python-tag cp36: Using setuptools (version 39.1.0). running bdist_wheel 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/Box2D.py -> build/lib.linux-x86_64-3.6/Box2D copying library/Box2D/init.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:66: Warning(302): Identifier 'b2Vec2' redefined by %extend (ignored), Box2D/Box2D_math.i:47: Warning(302): %extend definition of 'b2Vec2'. Box2D/Common/b2Math.h:157: Warning(302): Identifier 'b2Vec3' redefined by %extend (ignored), Box2D/Box2D_math.i:168: Warning(302): %extend definition of 'b2Vec3'. Box2D/Common/b2Math.h:196: Warning(302): Identifier 'b2Mat22' redefined by %extend (ignored), Box2D/Box2D_math.i:301: Warning(302): %extend definition of 'b2Mat22'. Box2D/Common/b2Math.h:270: Warning(302): Identifier 'b2Mat33' redefined by %extend (ignored), Box2D/Box2D_math.i:372: Warning(302): %extend definition of 'b2Mat33'. Box2D/Collision/b2DynamicTree.h:43: 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:90: Warning(509): Overloaded method b2Vec2::operator ()(int32) is shadowed by b2Vec2::operator ()(int32) const at Box2D/Common/b2Math.h:84. 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 gcc -pthread -B /root/anaconda3/envs/gymlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/root/anaconda3/envs/gymlab/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: In function ‘swig_module_info* SWIG_Python_GetModule()’: Box2D/Box2D_wrap.cpp:2453:51: error: ‘PyCObject_Import’ was not declared in this scope (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); ^ Box2D/Box2D_wrap.cpp: In function ‘void SWIG_Python_SetModule(swig_module_info*)’: Box2D/Box2D_wrap.cpp:2522:92: error: ‘PyCObject_FromVoidPtr’ was not declared in this scope PyObject *pointer = PyCObject_FromVoidPtr((void ) swig_module, SWIG_Python_DestroyModule); ^ Box2D/Box2D_wrap.cpp: In function ‘swig_type_info SWIG_Python_TypeQuery(const char*)’: Box2D/Box2D_wrap.cpp:2545:60: error: ‘PyCObject_AsVoidPtr’ was not declared in this scope descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); ^ Box2D/Box2D_wrap.cpp:2550:51: error: ‘PyCObject_FromVoidPtr’ was not declared in this scope obj = PyCObject_FromVoidPtr(descriptor, NULL); ^ error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for Box2D-kengz
Running setup.py clean for Box2D-kengz
Successfully built gym
Failed to build Box2D-kengz
Installing collected packages: Box2D-kengz, glfw, imageio, pycparser, cffi, Cython, mujoco-py, gym
Running setup.py install for Box2D-kengz ... error
Complete output from command /root/anaconda3/envs/gymlab/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5jh8n6q7/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-cwa7ey1x/install-record.txt --single-version-externally-managed --compile:
Using setuptools (version 39.1.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/Box2D.py -> build/lib.linux-x86_64-3.6/Box2D
copying library/Box2D/__init__.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:66: Warning(302): Identifier 'b2Vec2' redefined by %extend (ignored),
Box2D/Box2D_math.i:47: Warning(302): %extend definition of 'b2Vec2'.
Box2D/Common/b2Math.h:157: Warning(302): Identifier 'b2Vec3' redefined by %extend (ignored),
Box2D/Box2D_math.i:168: Warning(302): %extend definition of 'b2Vec3'.
Box2D/Common/b2Math.h:196: Warning(302): Identifier 'b2Mat22' redefined by %extend (ignored),
Box2D/Box2D_math.i:301: Warning(302): %extend definition of 'b2Mat22'.
Box2D/Common/b2Math.h:270: Warning(302): Identifier 'b2Mat33' redefined by %extend (ignored),
Box2D/Box2D_math.i:372: Warning(302): %extend definition of 'b2Mat33'.
Box2D/Collision/b2DynamicTree.h:43: 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:90: Warning(509): Overloaded method b2Vec2::operator ()(int32) is shadowed by b2Vec2::operator ()(int32) const at Box2D/Common/b2Math.h:84.
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
gcc -pthread -B /root/anaconda3/envs/gymlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/root/anaconda3/envs/gymlab/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: In function ‘swig_module_info* SWIG_Python_GetModule()’:
Box2D/Box2D_wrap.cpp:2453:51: error: ‘PyCObject_Import’ was not declared in this scope
(char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
^
Box2D/Box2D_wrap.cpp: In function ‘void SWIG_Python_SetModule(swig_module_info*)’:
Box2D/Box2D_wrap.cpp:2522:92: error: ‘PyCObject_FromVoidPtr’ was not declared in this scope
PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
^
Box2D/Box2D_wrap.cpp: In function ‘swig_type_info* SWIG_Python_TypeQuery(const char*)’:
Box2D/Box2D_wrap.cpp:2545:60: error: ‘PyCObject_AsVoidPtr’ was not declared in this scope
descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
^
Box2D/Box2D_wrap.cpp:2550:51: error: ‘PyCObject_FromVoidPtr’ was not declared in this scope
obj = PyCObject_FromVoidPtr(descriptor, NULL);
^
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/root/anaconda3/envs/gymlab/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5jh8n6q7/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-cwa7ey1x/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-5jh8n6q7/Box2D-kengz/
Upvotes: 1
Views: 266
Reputation: 5909
((swig issues :)) Box2D/Box2D_wrap.cpp: In function ‘swig_module_info* SWIG_Python_GetModule()’: Box2D/Box2D_wrap.cpp:2453:51: error: ‘PyCObject_Import’ was not declared in this scope
CentOS 6.9, a "build gym example". (Note: No Box2D, gym issues when using an other OS with swig3 installed by default.)
Build swig-3
cd swig-3.0.12/
./configure --with-php --without-go --prefix=/usr/
make
# make install
gym-0.10.5 :
git clone https://github.com/openai/gym.git
cd gym/
# scl enable rh-python36 bash
# pip3.6 install '.[all]'
.
.
Running setup.py install for Box2D-kengz ... done
Running setup.py install for glfw ... done
Running setup.py install for pycparser ... done
Running setup.py install for mujoco-py ... done
Running setup.py install for gym ... done
Successfully installed Box2D-kengz-2.3.3 Cython-0.28.2 cffi-1.11.5 glfw-1.6.0 gym-0.10.5 imageio-2.3.0 mujoco-py-1.50.1.56 pycparser-2.18
Upvotes: 0
Reputation: 193
According to the above error message I downloaded the latest version of Box2D to install, but reported the following error: [root@localhost Box2D-kengz-2.3.3]# python setup.py install Using setuptools (version 39.1.0). running install running bdist_egg running egg_info writing library/Box2D_kengz.egg-info/PKG-INFO writing dependency_links to library/Box2D_kengz.egg-info/dependency_links.txt writing top-level names to library/Box2D_kengz.egg-info/top_level.txt reading manifest file 'library/Box2D_kengz.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'INSTALL' warning: no files found matching 'MANIFEST' warning: no files found matching 'README' warning: no files found matching 'distribute_setup.py' warning: no files found matching '.py' under directory 'Box2D' warning: no files found matching '.c' under directory 'Box2D' writing manifest file 'library/Box2D_kengz.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py copying library/Box2D/Box2D.py -> build/lib.linux-x86_64-3.6/Box2D copying library/Box2D/init.py -> build/lib.linux-x86_64-3.6/Box2D 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:66: Warning(302): Identifier 'b2Vec2' redefined by %extend (ignored), Box2D/Box2D_math.i:47: Warning(302): %extend definition of 'b2Vec2'. Box2D/Common/b2Math.h:157: Warning(302): Identifier 'b2Vec3' redefined by %extend (ignored), Box2D/Box2D_math.i:168: Warning(302): %extend definition of 'b2Vec3'. Box2D/Common/b2Math.h:196: Warning(302): Identifier 'b2Mat22' redefined by %extend (ignored), Box2D/Box2D_math.i:301: Warning(302): %extend definition of 'b2Mat22'. Box2D/Common/b2Math.h:270: Warning(302): Identifier 'b2Mat33' redefined by %extend (ignored), Box2D/Box2D_math.i:372: Warning(302): %extend definition of 'b2Mat33'. Box2D/Collision/b2DynamicTree.h:43: 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:90: Warning(509): Overloaded method b2Vec2::operator ()(int32) is shadowed by b2Vec2::operator ()(int32) const at Box2D/Common/b2Math.h:84. gcc -pthread -B /root/anaconda3/envs/gymlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/root/anaconda3/envs/gymlab/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: In function ‘swig_module_info* SWIG_Python_GetModule()’: Box2D/Box2D_wrap.cpp:2453:51: error: ‘PyCObject_Import’ was not declared in this scope (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); ^ Box2D/Box2D_wrap.cpp: In function ‘void SWIG_Python_SetModule(swig_module_info*)’: Box2D/Box2D_wrap.cpp:2522:92: error: ‘PyCObject_FromVoidPtr’ was not declared in this scope PyObject *pointer = PyCObject_FromVoidPtr((void ) swig_module, SWIG_Python_DestroyModule); ^ Box2D/Box2D_wrap.cpp: In function ‘swig_type_info SWIG_Python_TypeQuery(const char*)’: Box2D/Box2D_wrap.cpp:2545:60: error: ‘PyCObject_AsVoidPtr’ was not declared in this scope descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); ^ Box2D/Box2D_wrap.cpp:2550:51: error: ‘PyCObject_FromVoidPtr’ was not declared in this scope obj = PyCObject_FromVoidPtr(descriptor, NULL); ^ error: command 'gcc' failed with exit status 1
Upvotes: 0