我在centos6.5系统上安装并部署了健身房。以下是安装过程。
Wget --no-check-certificate https://repo.anaconda.com/archive/Anaconda3-5.1.0-Linux-x86_64.sh
创建虚拟环境 Conda创建--name gymlab python = 3.6
安装健身房 来源激活健身房 Git克隆https://github.com/openai/gym.git Cd健身房 点击安装'。[全部]'
运行"点击安装'。[全部]' "最后一步,报告了以下错误: 加工/根/健身房 要求已经满足:numpy> = 1.10.4 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages(来自健身房== 0.10.5)(1.14.3) 要求已经满足:请求> = / in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages(来自健身房== 0.10.5)(2.18.4) 要求已经满足:六个/root/anaconda3/envs/gymlab/lib/python3.6/site-packages(来自健身房== 0.10.5)(1.11.0) 要求已经满足:pyrolet> = 1.2.0 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages(来自健身房== 0.10.5)(1.3.2) 要求已经满足:/ orotot/anaconda3/envs/gymlab/lib/python3.6/site-packages(来自健身房== 0.10.5)(0.1.1)atari_py> = 0.1.1 要求已经满足:枕头在/root/anaconda3/envs/gymlab/lib/python3.6/site-packages(来自健身房== 0.10.5)(5.1.0) 要求已经满足:/root/anaconda3/envs/gymlab/lib/python3.6/site-packages中的PyOpenGL(来自健身房== 0.10.5)(3.1.0) 收集Box2D-kengz(来自健身房== 0.10.5) 使用缓存的https://files.pythonhosted.org/packages/81/20/51d6c0c87f7642efb709c518fb0ca8e5eab068259588552c41da5926ae27/Box2D-kengz-2.3.3.tar.gz 收集mujoco_py> = 1.50(来自健身房== 0.10.5) 收集图像(来自健身房== 0.10.5) 使用缓存的https://files.pythonhosted.org/packages/a7/1d/33c8686072148b3b0fcc12a2e0857dd8316b8ae20a0fa66c8d6a6d01c05c/imageio-2.3.0-py2.py3-none-any.whl 要求已经满足:/deot/anaconda3/envs/gymlab/lib/python3.6/site-packages中的chardet< 3.1.0,> = 3.0.2(来自请求> = 2.0-> gym == 0.10.5 )(3.0.4) 要求已经满足:certoi> = 2017.4.17 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages(来自请求> = 2.0->健身房== 0.10.5)(2018.4.16) 要求已经满足:idro< 2.7,> = 2.5 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages(来自请求> = 2.0-> gym == 0.10.5)(2.6) 要求已经满足:urllib3< 1.23,> = 1.21.1 in /root/anaconda3/envs/gymlab/lib/python3.6/site-packages(来自请求> = 2.0->健身房== 0.10.5)( 1.22) 要求已经满足:未来/root/anaconda3/envs/gymlab/lib/python3.6/site-packages(来自pyglet> = 1.2.0-> gym == 0.10.5)(0.16.0) 收集glfw> = 1.4.0(来自mujoco_py> = 1.50->健身房== 0.10.5) 收集cffi> = 1.10(来自mujoco_py> = 1.50-> gym == 0.10.5) 使用缓存的https://files.pythonhosted.org/packages/6d/c0/47db8f624f3e4e2f3f27be03a93379d1ba16a1450a7b1aacfa0366e2c0dd/cffi-1.11.5-cp36-cp36m-manylinux1_x86_64.whl 收集Cython> = 0.27.2(来自mujoco_py> = 1.50-> gym == 0.10.5) 使用缓存的https://files.pythonhosted.org/packages/19/eb/c4d9f3beafd5ac0615936860bcee41d93ca58f8734a16715da0037d2c468/Cython-0.28.2-cp36-cp36m-manylinux1_x86_64.whl 收集pycparser(来自cffi> = 1.10-> mujoco_py> = 1.50-> gym == 0.10.5) 收集包装的轮子:健身房,Box2D-kengz 为健身房运行setup.py bdist_wheel ...完成 存储在目录中:/ tmp / pip-ephem-wheel-cache-or4iim1z / wheels / 6e / 18/10 / 1234738b0aafab3f8f70d61d2763dc3efda78a41d153584dee 为Box2D-kengz运行setup.py bdist_wheel ...错误 从命令/ root / anaconda3 / envs / gymlab / bin / python -u -c&#34完成输出;导入setuptools,tokenize; 文件 =' / tmp / pip-install-5jh8n6q7 /Box2D-kengz/setup.py';f=getattr(tokenize,' open',open)( file ); code = f.read()。replace( ' \ r \ n',' \ n'); f.close(); exec(编译(代码,文件,' exec&# 39))" bdist_wheel -d / tmp / pip-wheel-ckydr3cn --python-tag cp36: 使用setuptools(版本39.1.0)。 运行bdist_wheel 运行构建 运行build_py 创建构建 创建build / lib.linux-x86_64-3.6 创建build / lib.linux-x86_64-3.6 / Box2D 复制库/ Box2D / Box2D.py - >建立/ lib.linux-x86_64-3.6 / Box2D的 复制库/ Box2D / init .py - >建立/ lib.linux-x86_64-3.6 / Box2D的 创建build / lib.linux-x86_64-3.6 / Box2D / b2 复制库/ Box2D / b2 / init .py - >建立/ lib.linux-x86_64-3.6 / Box2D的/ B2 运行build_ext 建筑' Box2D._Box2D'延期 将Box2D / Box2D.i转移到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:警告(302):标识符< b2Vec2'由%extend(忽略)重新定义, Box2D / Box2D_math.i:47:警告(302):%扩展' b2Vec2'的定义。 Box2D / Common / b2Math.h:157:警告(302):标识符' b2Vec3'由%extend(忽略)重新定义, Box2D / Box2D_math.i:168:警告(302):%扩展' b2Vec3'的定义。 Box2D / Common / b2Math.h:196:警告(302):标识符' b2Mat22'由%extend(忽略)重新定义, Box2D / Box2D_math.i:301:警告(302):%扩展' b2Mat22'的定义。 Box2D / Common / b2Math.h:270:警告(302):标识符' b2Mat33'由%extend(忽略)重新定义, Box2D / Box2D_math.i:372:警告(302):%扩展' b2Mat33'的定义。 Box2D / Collision / b2DynamicTree.h:43:警告(312):当前不支持嵌套联合(忽略)。 Box2D / Common / b2Settings.h:144:警告(506):无法启用关键字参数的varargs Box2D / Common / b2Math.h:90:Warning(509):重载方法b2Vec2 :: operator()(int32)被Box2D / Common / b2Math.h:84处的b2Vec2 :: operator()(int32)const遮蔽。 创建build / temp.linux-x86_64-3.6 创建build / temp.linux-x86_64-3.6 / Box2D 创建build / temp.linux-x86_64-3.6 / Box2D / Dynamics 创建build / temp.linux-x86_64-3.6 / Box2D / Dynamics / Contacts 创建build / temp.linux-x86_64-3.6 / Box2D / Dynamics / Joints 创建build / temp.linux-x86_64-3.6 / Box2D / Common 创建build / temp.linux-x86_64-3.6 / Box2D / Collision 创建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-未使用 cc1plus:警告:命令行选项'-Wstrict-prototypes'对C / ObjC有效但对C ++无效 Box2D / Box2D_wrap.cpp:在函数'swig_module_info * SWIG_Python_GetModule()'中: Box2D / Box2D_wrap.cpp:2453:51:错误:未在此范围内声明'PyCObject_Import' (字符*)" type_pointer" SWIG_TYPE_TABLE_NAME); ^ Box2D / Box2D_wrap.cpp:在函数'void SWIG_Python_SetModule(swig_module_info *)'中: Box2D / Box2D_wrap.cpp:2522:92:错误:未在此范围内声明'PyCObject_FromVoidPtr' PyObject * pointer = PyCObject_FromVoidPtr((void )swig_module,SWIG_Python_DestroyModule); ^ Box2D / Box2D_wrap.cpp:在函数'swig_type_info SWIG_Python_TypeQuery(const char *)'中: Box2D / Box2D_wrap.cpp:2545:60:错误:在此范围内未声明'PyCObject_AsVoidPtr' descriptor =(swig_type_info *)PyCObject_AsVoidPtr(obj); ^ Box2D / Box2D_wrap.cpp:2550:51:错误:未在此范围内声明'PyCObject_FromVoidPtr' obj = PyCObject_FromVoidPtr(descriptor,NULL); ^ 错误:命令' gcc'退出状态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/
答案 0 :(得分:0)
根据上面的错误信息,我下载了最新版本的Box2D进行安装,但报告了以下错误: [root @ localhost Box2D-kengz-2.3.3] #python setup.py install 使用setuptools(版本39.1.0)。 运行安装 运行bdist_egg 运行egg_info 写图书馆/ Box2D_kengz.egg-info / PKG-INFO 将dependency_links写入library / Box2D_kengz.egg-info / dependency_links.txt 将顶级名称写入库/ Box2D_kengz.egg-info / top_level.txt 阅读清单文件' library / Box2D_kengz.egg-info / SOURCES.txt' 阅读清单模板' MANIFEST.in' 警告:找不到匹配' INSTALL' 警告:找不到匹配' MANIFEST' 警告:找不到匹配' README' 警告:找不到匹配' distribute_setup.py' 警告:找不到匹配' .py'在目录' Box2D' 警告:找不到匹配' .c'在目录' Box2D' 写清单文件' library / Box2D_kengz.egg-info / SOURCES.txt' 安装库代码来构建/ bdist.linux-x86_64 / egg 运行install_lib 运行build_py 复制库/ Box2D / Box2D.py - >建立/ lib.linux-x86_64-3.6 / Box2D的 复制库/ Box2D / init .py - >建立/ lib.linux-x86_64-3.6 / Box2D的 运行build_ext 建筑' Box2D._Box2D'延期 将Box2D / Box2D.i转移到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:警告(302):标识符< b2Vec2'由%extend(忽略)重新定义, Box2D / Box2D_math.i:47:警告(302):%扩展' b2Vec2'的定义。 Box2D / Common / b2Math.h:157:警告(302):标识符' b2Vec3'由%extend(忽略)重新定义, Box2D / Box2D_math.i:168:警告(302):%扩展' b2Vec3'的定义。 Box2D / Common / b2Math.h:196:警告(302):标识符' b2Mat22'由%extend(忽略)重新定义, Box2D / Box2D_math.i:301:警告(302):%扩展' b2Mat22'的定义。 Box2D / Common / b2Math.h:270:警告(302):标识符' b2Mat33'由%extend(忽略)重新定义, Box2D / Box2D_math.i:372:警告(302):%扩展' b2Mat33'的定义。 Box2D / Collision / b2DynamicTree.h:43:警告(312):当前不支持嵌套联合(忽略)。 Box2D / Common / b2Settings.h:144:警告(506):无法启用关键字参数的varargs Box2D / Common / b2Math.h:90:Warning(509):重载方法b2Vec2 :: operator()(int32)被Box2D / Common / b2Math.h:84处的b2Vec2 :: operator()(int32)const遮蔽。 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-未使用 cc1plus:警告:命令行选项'-Wstrict-prototypes'对C / ObjC有效但对C ++无效 Box2D / Box2D_wrap.cpp:在函数'swig_module_info * SWIG_Python_GetModule()'中: Box2D / Box2D_wrap.cpp:2453:51:错误:未在此范围内声明'PyCObject_Import' (字符*)" type_pointer" SWIG_TYPE_TABLE_NAME); ^ Box2D / Box2D_wrap.cpp:在函数'void SWIG_Python_SetModule(swig_module_info *)'中: Box2D / Box2D_wrap.cpp:2522:92:错误:未在此范围内声明'PyCObject_FromVoidPtr' PyObject * pointer = PyCObject_FromVoidPtr((void )swig_module,SWIG_Python_DestroyModule); ^ Box2D / Box2D_wrap.cpp:在函数'swig_type_info SWIG_Python_TypeQuery(const char *)'中: Box2D / Box2D_wrap.cpp:2545:60:错误:在此范围内未声明'PyCObject_AsVoidPtr' descriptor =(swig_type_info *)PyCObject_AsVoidPtr(obj); ^ Box2D / Box2D_wrap.cpp:2550:51:错误:未在此范围内声明'PyCObject_FromVoidPtr' obj = PyCObject_FromVoidPtr(descriptor,NULL); ^ 错误:命令' gcc'退出状态1失败
答案 1 :(得分:0)
((swig issues :)) Box2D / Box2D_wrap.cpp:在函数'swig_module_info * SWIG_Python_GetModule()'中: Box2D / Box2D_wrap.cpp:2453:51:错误:'PyCObject_Import'未在此范围内声明
CentOS 6.9 ,一个"构建健身房示例"。 (注意:没有Box2D,健身房在使用默认安装了swig3的其他操作系统时会出现问题。)
构建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