I installed and deployed the gym on the centos6.5 system. The following is the installation process.
Install anaconda
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/
((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
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
Related
I am working on installing a repository on my Linux and can't seem to download a package correctly. For background, I am a grad research assistant and my post doc is building a package he wants me to test. It's a new version so it could be the package issue but I am also new to coding and it might just be me/my computer.
I am trying pip install rsnapsim-ssa-cpp
I double checked that I have cpp on my computer (which is g++ on linux i gathered) and it is up to date.
It starts working but when it gets to build wheel, it breaks down.
The main error, at end of all the error code is,
ERROR: Could not build wheels for rsnapsim-ssa-cpp which use PEP 517 and cannot be installed directly
The full description of error is below
(base) bsilagy#ENS12372 ~ $ pip install rsnapsim-ssa-cpp
Collecting rsnapsim-ssa-cpp
Using cached rsnapsim_ssa_cpp-0.0.12.tar.gz (97 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: numpy in ./anaconda3/lib/python3.8/site-packages (from rsnapsim-ssa-cpp) (1.20.1)
Requirement already satisfied: Cython>=0.26.0 in ./anaconda3/lib/python3.8/site-packages (from rsnapsim-ssa-cpp) (0.29.21)
Building wheels for collected packages: rsnapsim-ssa-cpp
Building wheel for rsnapsim-ssa-cpp (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /home/bsilagy/anaconda3/bin/python /home/bsilagy/anaconda3/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpyouz1bwc
cwd: /tmp/pip-install-ax10ddh9/rsnapsim-ssa-cpp
Complete output (50 lines):
Warning: passing language='c++' to cythonize() is deprecated. Instead, put "# distutils: language=c++" in your .pyx or .pxd file(s)
/home/bsilagy/anaconda3
Located eigen3/Eigen/Dense:
['/home/bsilagy/anaconda3/include', '/home/bsilagy/anaconda3/pkgs/eigen-3.3.7-hfd86e86_0/include']
running bdist_wheel
running build
running build_ext
skipping 'ssa_translation_lowmem.cpp' Cython extension (up-to-date)
building 'ssa_translation_lowmem' extension
creating build
creating build/temp.linux-x86_64-3.8
gcc -pthread -B /home/bsilagy/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/bsilagy/anaconda3/include/python3.8 -I/tmp/pip-build-env-tq8h27ra/overlay/lib/python3.8/site-packages/numpy/core/include -I. -I/tmp/pip-install-ax10ddh9/rsnapsim-ssa-cpp -I/home/bsilagy/anaconda3/include -I/home/bsilagy/anaconda3/include/python3.8 -c ssa_translation_c_w_full.cpp -o build/temp.linux-x86_64-3.8/ssa_translation_c_w_full.o -I. -I./Include -I/home/bsilagy/anaconda3/include
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /usr/include/c++/5/random:35:0,
from ssa_translation_c_w_full.cpp:7:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
^
ssa_translation_c_w_full.cpp: In function ‘void translationSSA_full(int*, double*, double*, int, double, double, int*, int, int, int, double, int, double*, int*, int, int, int*, int, int*, double*, int*, int, int*, int, int*, int, int*, double, double, double*, int*, int*, int)’:
ssa_translation_c_w_full.cpp:69:2: error: ‘mt19937_64’ is not a member of ‘std’
std::mt19937_64 rng;
^
ssa_translation_c_w_full.cpp:74:5: error: ‘rng’ was not declared in this scope
rng.seed(seed);
^
ssa_translation_c_w_full.cpp:75:2: error: ‘uniform_real_distribution’ is not a member of ‘std’
std::uniform_real_distribution<double> unif(0, 1);
^
ssa_translation_c_w_full.cpp:75:33: error: expected primary-expression before ‘double’
std::uniform_real_distribution<double> unif(0, 1);
^
ssa_translation_c_w_full.cpp:138:16: error: ‘unif’ was not declared in this scope
r1 = unif(rng);
^
ssa_translation_c_w_full.cpp:141:8: warning: unused variable ‘burst’ [-Wunused-variable]
int burst = 1;
^
ssa_translation_c_w_full.cpp:139:7: warning: unused variable ‘burst’ [-Wunused-variable]
int burst = 0; // is the system bursting on or off_type with proprotion to kon / koff
^
ssa_translation_c_w_full.cpp:218:19: error: ‘unif’ was not declared in this scope
r1 = unif(rng);
^
ssa_translation_c_w_full.cpp:295:23: error: ‘unif’ was not declared in this scope
r1 = unif(rng);
^
ssa_translation_c_w_full.cpp:127:9: warning: unused variable ‘NR’ [-Wunused-variable]
int NR = 0;
^
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for rsnapsim-ssa-cpp
Failed to build rsnapsim-ssa-cpp
ERROR: Could not build wheels for rsnapsim-ssa-cpp which use PEP 517 and cannot be installed directly
Can someone please help/advise?
I'm trying to install pytorch
python setup.py install
but it fails as it can't locate libavutil/motion_vector.h
[ 66%] Building CXX object caffe2/CMakeFiles/torch.dir/video/video_input_op.cc.o
In file included from /root/pytorch/caffe2/video/video_input_op.h:15:0,
from /root/pytorch/caffe2/video/video_input_op.cc:1:
/root/pytorch/caffe2/video/video_decoder.h:15:37: fatal error: libavutil/motion_vector.h: No such file or directory
#include <libavutil/motion_vector.h>
^
compilation terminated.
[ 66%] Building CXX object caffe2/CMakeFiles/torch.dir/video/video_io.cc.o
make[2]: *** [caffe2/CMakeFiles/torch.dir/video/video_input_op.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /root/pytorch/caffe2/video/video_io.h:6:0,
from /root/pytorch/caffe2/video/video_io.cc:1:
/root/pytorch/caffe2/video/video_decoder.h:15:37: fatal error: libavutil/motion_vector.h: No such file or directory
#include <libavutil/motion_vector.h>
^
compilation terminated.
make[2]: *** [caffe2/CMakeFiles/torch.dir/video/video_io.cc.o] Error 1
make[1]: *** [caffe2/CMakeFiles/torch.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
File "setup.py", line 759, in <module>
build_deps()
File "setup.py", line 321, in build_deps
cmake=cmake)
File "/root/pytorch/tools/build_pytorch_libs.py", line 63, in build_caffe2
cmake.build(my_env)
File "/root/pytorch/tools/setup_helpers/cmake.py", line 330, in build
self.run(build_args, my_env)
File "/root/pytorch/tools/setup_helpers/cmake.py", line 143, in run
check_call(command, cwd=self.build_dir, env=env)
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '12']' returned non-zero exit status 2
What I've tried so far:
installed libavutil-dev
ensured ffmpeg is installed
followed https://github.com/facebookresearch/VMZ/blob/master/tutorials/Installation_guide.md
Any other ideas?
Missing headers of libraries commonly indicate missing development packages. For Debian and Ubuntu the package you are looking for is most likely called libavutil-dev. Try installing this package using you package manager and re-running the pip installation. For Fedora and SUSE the package should end with -devel.
For conda installation, firstly create an env, very important because you've used pip (pip stops conda seeing it's base env).
conda create -n pytorch_env python=3.7
source activate pytorch_env
conda install -c anaconda mkl
Then install pytorch and torch vision
conda install -c pytorch pytorch torchvision
You might want to run these as administrator, for me not needed.
You will need to install Caffe via
conda install -c caffe2 pytorch-nightly
There's a bug for caffe2 installation (not nightly). Corrected below,
conda create -n pytorch_env python=3.6
source activate pytorch_env
conda install -c caffe2 caffe2
Having done this I found opencv and ffmpeg were loaded .. I can only assume they were a dependency of caffe2. Thus in summary yes you can do the whole thing easily via conda once the 3.7 -> 3.6 bug is resolved
I'm having some issues getting installing pdftotext in Python 3.6 (Anaconda 5.1.0) on CentOS.
Some quick notes first:
I'm using CentOS 6.7 on VirtualBox
I know it can work because my IT group has it installed on our server. NOTE: I found that our server did have the C++ wrapper installed and I'm trying to figure out how the got it.
I'm trying to get an existing application to work, so I'm not looking for an alternative to pdftotext the library at this time.
I followed the instructions from the github repo and already tried this step:
Fedora, Red Hat, and friends:
sudo yum install gcc-c++ pkgconfig poppler-cpp-devel python-devel redhat-rpm-config
But the problem seems to be around poppler-cpp-devel. I don't see that package within yum search poppler:
============================= N/S Matched: poppler =============================
poppler-devel.i686 : Libraries and headers for poppler
poppler-devel.x86_64 : Libraries and headers for poppler
poppler-glib.i686 : Glib wrapper for poppler
poppler-glib.x86_64 : Glib wrapper for poppler
poppler-qt.i686 : Qt3 wrapper for poppler
poppler-qt.x86_64 : Qt3 wrapper for poppler
poppler-qt4.i686 : Qt4 wrapper for poppler
poppler-qt4.x86_64 : Qt4 wrapper for poppler
poppler.i686 : PDF rendering library
poppler.x86_64 : PDF rendering library
poppler-data.noarch : Encoding files
poppler-glib-devel.i686 : Development files for glib wrapper
poppler-glib-devel.x86_64 : Development files for glib wrapper
poppler-qt-devel.i686 : Development files for Qt3 wrapper
poppler-qt-devel.x86_64 : Development files for Qt3 wrapper
poppler-qt4-devel.i686 : Development files for Qt4 wrapper
poppler-qt4-devel.x86_64 : Development files for Qt4 wrapper
poppler-utils.x86_64 : Command line utilities for converting PDF files
My IT group gave me the instructions of what they had attempted and I tried installing poppler-devel and poppler-glib. But every time I try pip install pdftotext I'm getting the following output:
[root#localhost stack]# pip install pdftotext
Collecting pdftotext
Using cached https://files.pythonhosted.org/packages/21/35/60094dbadd9de2035873390b1cac25e01da605844eba6a07a53a82fa4adc/pdftotext-2.1.1.tar.gz
Building wheels for collected packages: pdftotext
Building wheel for pdftotext (setup.py) ... error
Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-1mu2f1n2/pdftotext/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-khm9zova --python-tag cp36:
/root/anaconda3/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running bdist_wheel
running build
running build_ext
building 'pdftotext' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -B /root/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPOPPLER_CPP_AT_LEAST_0_30_0=0 -I/root/anaconda3/include/python3.6m -c pdftotext.cpp -o build/temp.linux-x86_64-3.6/pdftotext.o -Wall
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
pdftotext.cpp:3:42: error: poppler/cpp/poppler-document.h: No such file or directory
pdftotext.cpp:4:40: error: poppler/cpp/poppler-global.h: No such file or directory
pdftotext.cpp:5:38: error: poppler/cpp/poppler-page.h: No such file or directory
pdftotext.cpp:20: error: ‘poppler’ has not been declared
pdftotext.cpp:20: error: ISO C++ forbids declaration of ‘document’ with no type
pdftotext.cpp:20: error: expected ‘;’ before ‘*’ token
pdftotext.cpp: In function ‘void PDF_clear(PDF*)’:
pdftotext.cpp:26: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp:27: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp: In function ‘int PDF_create_doc(PDF*)’:
pdftotext.cpp:66: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp:66: error: ‘poppler’ has not been declared
pdftotext.cpp:67: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp: In function ‘int PDF_unlock(PDF*, char*)’:
pdftotext.cpp:75: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp: In function ‘int PDF_init(PDF*, PyObject*, PyObject*)’:
pdftotext.cpp:105: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp: In function ‘PyObject* PDF_read_page(PDF*, int)’:
pdftotext.cpp:119: error: ‘poppler’ has not been declared
pdftotext.cpp:119: error: expected initializer before ‘*’ token
pdftotext.cpp:120: error: ‘poppler’ has not been declared
pdftotext.cpp:120: error: expected ‘;’ before ‘layout_mode’
pdftotext.cpp:123: error: ‘page’ was not declared in this scope
pdftotext.cpp:123: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp:129: error: ‘poppler’ has not been declared
pdftotext.cpp:129: error: expected initializer before ‘rect’
pdftotext.cpp:130: error: ‘rect’ was not declared in this scope
pdftotext.cpp:133: error: ‘layout_mode’ was not declared in this scope
pdftotext.cpp:133: error: ‘poppler’ has not been declared
pdftotext.cpp:135: error: ‘poppler’ has not been declared
pdftotext.cpp:137: error: ‘poppler’ has not been declared
pdftotext.cpp:138: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pdftotext
Running setup.py clean for pdftotext
Failed to build pdftotext
Installing collected packages: pdftotext
Running setup.py install for pdftotext ... error
Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-1mu2f1n2/pdftotext/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-ghuhvuhl/install-record.txt --single-version-externally-managed --compile:
/root/anaconda3/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_ext
building 'pdftotext' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -B /root/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPOPPLER_CPP_AT_LEAST_0_30_0=0 -I/root/anaconda3/include/python3.6m -c pdftotext.cpp -o build/temp.linux-x86_64-3.6/pdftotext.o -Wall
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
pdftotext.cpp:3:42: error: poppler/cpp/poppler-document.h: No such file or directory
pdftotext.cpp:4:40: error: poppler/cpp/poppler-global.h: No such file or directory
pdftotext.cpp:5:38: error: poppler/cpp/poppler-page.h: No such file or directory
pdftotext.cpp:20: error: ‘poppler’ has not been declared
pdftotext.cpp:20: error: ISO C++ forbids declaration of ‘document’ with no type
pdftotext.cpp:20: error: expected ‘;’ before ‘*’ token
pdftotext.cpp: In function ‘void PDF_clear(PDF*)’:
pdftotext.cpp:26: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp:27: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp: In function ‘int PDF_create_doc(PDF*)’:
pdftotext.cpp:66: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp:66: error: ‘poppler’ has not been declared
pdftotext.cpp:67: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp: In function ‘int PDF_unlock(PDF*, char*)’:
pdftotext.cpp:75: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp: In function ‘int PDF_init(PDF*, PyObject*, PyObject*)’:
pdftotext.cpp:105: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp: In function ‘PyObject* PDF_read_page(PDF*, int)’:
pdftotext.cpp:119: error: ‘poppler’ has not been declared
pdftotext.cpp:119: error: expected initializer before ‘*’ token
pdftotext.cpp:120: error: ‘poppler’ has not been declared
pdftotext.cpp:120: error: expected ‘;’ before ‘layout_mode’
pdftotext.cpp:123: error: ‘page’ was not declared in this scope
pdftotext.cpp:123: error: ‘struct PDF’ has no member named ‘doc’
pdftotext.cpp:129: error: ‘poppler’ has not been declared
pdftotext.cpp:129: error: expected initializer before ‘rect’
pdftotext.cpp:130: error: ‘rect’ was not declared in this scope
pdftotext.cpp:133: error: ‘layout_mode’ was not declared in this scope
pdftotext.cpp:133: error: ‘poppler’ has not been declared
pdftotext.cpp:135: error: ‘poppler’ has not been declared
pdftotext.cpp:137: error: ‘poppler’ has not been declared
pdftotext.cpp:138: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-1mu2f1n2/pdftotext/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-ghuhvuhl/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-1mu2f1n2/pdftotext/
I'm assuming the problem here is that it's looking for the C++ compiled files and I could only get the glib?
What I can look into?
pdftotext should be in poppler-utils, so try yum install poppler-utils
EDIT: Hmm. There's a package called pypoppler available for CentOS 6 in the EPEL repository, which describes itself as "Python bindings for the Poppler PDF rendering library." I see no indication that it includes poppler/cpp/{anything}, but you can give it a try. (You may need to install pycairo first.)
Failing that, you might try installing an earlier version of pdftotext (e.g. pip install pdftotext==1.0.0) to find one compatible with CentOS 6. The earliest version came out in June of 2017, though, so that may not help.
I don't suppose you're interested in upgrading to CentOS 7?
There actually is a proper CentOS 7 package. It is not enough to install the poppler-devel package as it does not include the CPP header files that is required and you simply need to install the poppler-cpp and poppler-cpp-devel packages:
yum install poppler-cpp poppler-cpp-devel
After this you can pip/pip3 install the pdftotext package without custom compiling and setting environment path variables.
I found the solution to this. By following the instructions for installing libpoppler-cpp from this link, I was able to successfully install the pdftotext.
Following the instructions from this repo:
On CentOS
On CentOS the libpoppler-cpp library is not included with the system so we need to build from source. Note that recent versions of poppler require C++11 which is not available on CentOS, so we build a slightly older version of libpoppler.
# Build dependencies
yum install wget xz libjpeg-devel openjpeg2-devel
# Download and extract
wget https://poppler.freedesktop.org/poppler-0.47.0.tar.xz
tar -Jxvf poppler-0.47.0.tar.xz
cd poppler-0.47.0
# Build and install
./configure
make
sudo make install
By default libraries get installed in /usr/local/lib and /usr/local/include. On CentOS this is not a default search path so we need to set PKG_CONFIG_PATH and LD_LIBRARY_PATH to point R to the right directory:
export LD_LIBRARY_PATH="/usr/local/lib"
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
I'm following the tutorial for SWIG and Python, but I'm getting an error when I try to import the compiled extension in Python.
Python 3.5.2 (default, Oct 11 2016, 15:01:25)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
>>> import _example
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/pat/to/_example.cpython-35m-darwin.so, 2): Symbol not found: _fact
Referenced from: /path/to/_example.cpython-35m-darwin.so
Expected in: flat namespace
in /path/to/_example.cpython-35m-darwin.so
Note that the error says it can't find the symbol _fact. I'm not sure where the leading underscore is coming from, and I can't find any information about how to resolve this problem.
Here is example.i (matches what's in the tutorial):
%module example
%{
#define SWIG_FILE_WITH_INIT
#include "example.h"
%}
int fact(int n);
example.h and example.c also match what's in the tutorial; I can post here if necessary.
Here's setup.py:
# coding=utf-8
from setuptools import Extension, setup
setup(
name = 'SWIG Test',
ext_modules = [Extension('_example', ['example.i'])],
py_modules = ['example'],
)
This is the relevant output of pip install -e . -v:
running build_ext
building '_example' extension
swigging example.i to example_wrap.c
swig -python -o example_wrap.c example.i
creating build
creating build/temp.macosx-10.12-x86_64-3.5
/usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -pipe -Os -I/opt/local/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c example_wrap.c -o build/temp.macosx-10.12-x86_64-3.5/example_wrap.o
creating build/lib.macosx-10.12-x86_64-3.5
/usr/bin/clang -bundle -undefined dynamic_lookup -L/opt/local/lib -Wl,-headerpad_max_install_names build/temp.macosx-10.12-x86_64-3.5/example_wrap.o -o build/lib.macosx-10.12-x86_64-3.5/_example.cpython-35m-darwin.so
copying build/lib.macosx-10.12-x86_64-3.5/_example.cpython-35m-darwin.so ->
Some things that I've tried that didn't work:
Declaring fact as int fact(int n) asm("fact") (after building, I get Symbol not found: fact when importing).
Adding swig_opts=['-py3'] to the extension in setup.py.
The leading underscore was a red herring. Turns out, I simply forgot to include example.c in my extension sources.
Here's what setup.py is supposed to look like:
# coding=utf-8
from setuptools import Extension, setup
setup(
name = 'SWIG Test',
ext_modules = [Extension('_example', ['example.i', 'example.c'])],
py_modules = ['example'],
)
Note that the extension has both example.i and example.c in its sources.
Now everything works as expected (:
Python 3.5.2 (default, Oct 11 2016, 15:01:25)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
>>> import example
>>> example.fact(42)
0
>>> example.fact(0)
1
I'm trying to install Biopython 1.61. I'm logged in as root in a bash terminal. I'm using Mageia 2.0, and I've updated all the packages/programs on the OS (with urpmi update -a).
I extracted the source, then ran python setup.py build, which had two errors:
FAIL: test_protein_16130152 (test_SeqIO_online.EntrezTests)
Bio.Entrez.efetch(protein, 16130152, ...)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_SeqIO_online.py", line 77, in <lambda>
method = lambda x : x.simple(d, f, e, l, c)
File "test_SeqIO_online.py", line 65, in simple
self.assertEqual(seguid(record.seq), checksum)
AssertionError: 'NT/aFiTXyD/7KixizZ9sq2FcniU' != 'fCjcjMFeGIrilHAn6h+yju267lg'
======================================================================
ERROR: test_doctests (test_Tutorial.TutorialTestCase)
Run tutorial doctests.
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_Tutorial.py", line 152, in test_doctests
ValueError: 4 Tutorial doctests failed: test_from_line_05671, test_from_line_06030, test_from_line_06190, test_from_line_06479
Then I ran python setup.py install, but it failed, too. I updated my python with (urpmi install lib64python-devel) and my gcc, but it was already up to date.
This is the error I get from python setup.py install:
[root#localhost biopython-1.61]# python setup.py install
running install
running build
running build_py
warning: build_py_biopython: byte-compiling is disabled, skipping.
running build_ext
building 'Bio.Cluster.cluster' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -I/usr/include/ncursesw -DNDEBUG -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -g -fPIC -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c Bio/Cluster/clustermodule.c -o build/temp.linux-x86_64-2.7/Bio/Cluster/clustermodule.o
Bio/Cluster/clustermodule.c:2:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
The unit test failures have been fixed in Biopython itself.
The compiler error suggests you are missing the NumPy header files, often included in the OS package manager in a separate package called something like numpy-dev or numpy-devel.