I'm trying to install Python 3.8.5 using pyenv on Centos 6 Docker image. I am getting the below error:
Downloading Python-3.6.12.tar.xz...
-> https://www.python.org/ftp/python/3.6.12/Python-3.6.12.tar.xz Installing Python-3.6.12...
BUILD FAILED (CentOS release 6.10 (Final) using python-build
1.2.22-47-g4c302a0)
Inspect or clean up the working tree at
/tmp/python-build.20210131203049.150 Results logged to
/tmp/python-build.20210131203049.150.log
Last 10 log lines: checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes checking if g++ supports
-c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking
dynamic linker characteristics... (cached) GNU/Linux ld.so checking
how to hardcode library paths into programs... immediate checking size
of size_t... 8 checking for C compiler vendor... gcc -pthread -shared
-L/root/.pyenv/versions/3.6.12/lib -L/root/.pyenv/versions/3.6.12/lib -L/root/.pyenv/versions/3.6.12/lib -I/root/.pyenv/versions/3.6.12/include build/temp.linux-x86_64-3.6/tmp/python-build.20210131203049.150/Python-3.6.12/Modules/pyexpat.o
build/temp.linux-x86_64-3.6/tmp/python-build.20210131203049.150/Python-3.6.12/Modules/expat/xmlparse.o
build/temp.linux-x86_64-3.6/tmp/python-build.20210131203049.150/Python-3.6.12/Modules/expat/xmlrole.o
build/temp.linux-x86_64-3.6/tmp/python-build.20210131203049.150/Python-3.6.12/Modules/expat/xmltok.o
-L/root/.pyenv/versions/3.6.12/lib -L/usr/local/lib -o build/lib.linux-x86_64-3.6/pyexpat.cpython-36m-x86_64-linux-gnu.so
/bin/sh: line 9: 8442 Killed CC='gcc -pthread'
LDSHARED='gcc -pthread -shared -L/root/.pyenv/versions/3.6.12/lib
-L/root/.pyenv/versions/3.6.12/lib ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py $quiet build make: *** [sharedmods] Error 137
Looks like you're missing a dep. Try this:
$ sudo yum install openssl-devel
If that's not enough, several other relevant deps are mentioned on https://joshspicer.com/python37-ssl-issue
Notice that merely having openssl installed
is not sufficient.
You need the -devel form of the package.
It contains essential ingredients, such as *.h header files,
that are necessary for the build to succeed.
Use $ yum list installed to see what you have ATM.
You might find e.g. yum list installed | grep -i openssl convenient.
Related
when i install the cryptography,there have some errors,for the platform is :
[root#RHanible ~]# python -V
Python 2.7.11
[root#RHanible ~]# rpm -qa openssl
openssl-1.0.0-20.el6.x86_64
[root#RHanible ~]# rpm -qa openssl-devel
openssl-devel-1.0.0-20.el6.x86_64
[root#RHanible ~]# rpm -qa python-devel
python-devel-2.6.6-29.el6.x86_64
[root#RHanible ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.2 (Santiago)
the errors is following:
already up-to-date
building '_openssl' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/python/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o
build/temp.linux-x86_64-2.7/_openssl.c:2078: warning: function declaration isn?. a prototype
build/temp.linux-x86_64-2.7/_openssl.c:2079: warning: function declaration isn?. a prototype
build/temp.linux-x86_64-2.7/_openssl.c:2080: warning: function declaration isn?. a prototype
build/temp.linux-x86_64-2.7/_openssl.c:2105: warning: function declaration isn?. a prototype
build/temp.linux-x86_64-2.7/_openssl.c:2163: warning: function declaration isn?. a prototype
build/temp.linux-x86_64-2.7/_openssl.c: In function ?.cffi_const_CMS_DEBUG_DECRYPT?.
build/temp.linux-x86_64-2.7/_openssl.c:8193: error: ?.MS_DEBUG_DECRYPT?.undeclared (first use in this function)
build/temp.linux-x86_64-2.7/_openssl.c:8193: error: (Each undeclared identifier is reported only once
build/temp.linux-x86_64-2.7/_openssl.c:8193: error: for each function it appears in.)
error: command 'gcc' failed with exit status 1
I used following steps and it worked for me on my virtual environment. First, I installed python development headers and libevent headers.
sudo apt-get install python-dev
sudo apt-get install libevent-dev
then, I used documentation
https://cryptography.io/en/latest/installation/#building-cryptography-on-linux
I have simple python + cython project (hello world example from http://docs.cython.org/src/tutorial/cython_tutorial.html) on my ubuntu 16 x86_64. I can build this project with cython for x86_64.
How can I build the project for armv7 version of ubuntu 15 without using real armv7 board/cpu?
I have arm-linux-gnueabihf-gcc (http://packages.ubuntu.com/xenial/devel/gcc-arm-linux-gnueabihf) and it can compile simple C programs for armv7. How can I change settings of cython to use cross compiler for building shared objects for arm?
Architecture dependent libraries and headers files are needed for cross compiling.
When testing if python3.5-dev package and others could be installed after dpkg --add-architecture armhf and apt-get update (after some modification to sources.list), the result was basically.
python3.5-dev:armhf : Depends: python3.5:armhf (= 3.5.1-10) but it is not going to be installed
apt-get install python3.5:armhf is something that doesn't work, see
The existing proposals allow for the co-installation of libraries and
headers for different architectures, but not (yet) binaries.
One possible solution that does not require "full" virtual machine is provided by QEMU and chroot. A suitable directory for chroot can be created by debootstrap command. After creation, schroot can give access to that environment.
Substitute <DIRECTORY> and <USER> in the following commands:
apt-get install -y debootstrap qemu-user-static binfmt-support schroot
debootstrap --arch=armhf --foreign --include=gcc,g++,python3.5-dev xenial <DIRECTORY>
cp /usr/bin/qemu-arm-static <DIRECTORY>/usr/bin
chroot <DIRECTORY>
/debootstrap/debootstrap --second-stage
echo "deb http://ports.ubuntu.com/ubuntu-ports xenial universe" >> /etc/apt/sources.list
echo "deb http://ports.ubuntu.com/ubuntu-ports xenial multiverse" >> /etc/apt/sources.list
apt-get update
apt-get install -y cython cython3
exit
cat <<END > /etc/schroot/chroot.d/xenial-armhf
[xenial-armhf]
description=Ubuntu xenial armhf
type=directory
directory=/home/xenial-armhf
groups=sbuild,root
root-groups=sbuild,root
users=root,<USER>
END
The environment should be accessible by
schroot -c chroot:xenial-armhf
and for root user session (the user must be in a group listed in root-groups) ,
schroot -c chroot:xenial-armhf -u root
After this, it is also possible to cross compile a cython module:
hello.pyx:
print("hello world")
compiling (python3.5-config --cflags and python3.5-config --libs in chroot for options, note -fPIC):
cython hello.pyx
arm-linux-gnueabihf-gcc --sysroot <DIRECTORY> -I/usr/include/python3.5m -I/usr/include/python3.5m -Wno-unused-result -Wsign-compare -g -fstack-protector-strong -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c hello.c
arm-linux-gnueabihf-gcc --shared --sysroot <DIRECTORY> -lpython3.5m -lpthread -ldl -lutil -lm hello.o -o hello.so
The module can be then tested
schroot -c chroot:xenial-armhf
python3
import hello
Cross compiling cython based python modules may also work. With setup.py
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import os
os.environ['CC'] = 'arm-linux-gnueabihf-gcc'
os.environ['LDSHARED'] = 'arm-linux-gnueabihf-gcc -shared'
sysroot_args=['--sysroot', '/path/to/xenial-armhf']
setup(cmdclass = {'build_ext': build_ext},
ext_modules= [ Extension("hello", ["hello.pyx"],
extra_compile_args=sysroot_args,
extra_link_args=sysroot_args) ])
Building a simple hello world module was possible this way. The file name for the module was wrong, in this case it was hello.cpython-35m-x86_64-linux-gnu.so. After renaming it as hello.so it was possible to import it.
I've been trying to install Pygame for days now, and the only dependency missing is smpeg. I get the following output:
brew install --HEAD smpeg
==> Installing dependencies for smpeg: gobject-introspection, gdk-pixbuf,
==> Installing smpeg dependency: gobject-introspection
==> Building source; bottle blocked by python requirement
==> Downloading http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/1.4
Already downloaded: /Library/Caches/Homebrew/gobject-introspection-1.40.0.tar.xz
==> ./configure --prefix=/usr/local/Cellar/gobject-introspection/1.40.0
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/sitepackages
checking for headers required to compile python extensions... ./configure: line 14647: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/pytho n-config: No such file or directory
not found
configure: error: Python headers not found
I've also tried to brew edit smpeg, adding include.install Dir["*.h"] above the two end at the end of the code, but to no avail.
My brew doctor says:
Warning: Python is installed at /Library/Frameworks/Python.framework
Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.
My brew list says:
autoconf git libgcrypt mpfr sdl_mixer
automake glib libgpg-error pkg-config sdl_ttf
cloog gmp libmpc portmidi tree
cmake gnu-getopt libpng pwgen webp
freetype isl libtiff sdl xz
gettext jpeg libtool sdl_gfx
gfortran libffi mercurial sdl_image
brew --config:
==> Configuration
HOMEBREW_VERSION: 0.9.5
HEAD: 7448fd1532ae1c1709fe2f03ffe0dc188a134b3e
CPU: quad-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
X11: 2.7.5 => /opt/X11
brew was updated and upgraded
I have Python 2.7.6
Later I've managed to install smpeg.h (and MPEGfilter.h) in Python.framework/Versions/2.7/include/python and now when I run python setup.py install from cd pygame-1.9.1release, I get:
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ddarwin -I/Library/Frameworks/SDL.framework/Versions/Current/Headers -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/movie.c -o build/temp.macosx-10.3-fat-2.7/src/movie.o
In file included from src/movie.c:26:
In file included from src/pygame.h:106:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL.h:30:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_main.h:26:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_stdinc.h:30:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_config.h:34:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_config_macosx.h:29:
/usr/include/AvailabilityMacros.h:110:14: warning: Building for Intel with Mac
OS X Deployment Target < 10.4 is invalid. [-W#warnings]
#warning Building for Intel with Mac OS X Deployment Target ...
^
1 warning generated.
/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -g build/temp.macosx-10.3-fat-2.7/src/movie.o -ls -lm -lp -le -lg -o build/lib.macosx-10.3-fat-2.7/pygame/movie.so -framework SDL -F/Library/Frameworks/
ld: library not found for -ls
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1
got it. did this: inside 'pygame-1.9.1release', 'cd src, emacs scale_mmx64.c'. there I looked for all occurrences of 'movsxl' and replaced them (two) with with 'movslq'. then 'sudo pip install hg+http://bitbucket.org/pygame/pygame worked'.
I want to install the python library scikit-bio via pip using following command:
sudo pip install scikit-bio
on my system:
uname -a
Linux grassgis 3.2.0-69-generic-pae #103-Ubuntu SMP Tue Sep 2 05:15:53 UTC 2014 i686 i686 i386 GNU/Linux
However this causes an error:
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c skbio/alignment/_ssw/_ssw_wrapper.c -o build/temp.linux-i686-2.7/skbio/alignment/_ssw/_ssw_wrapper.o
In file included from skbio/alignment/_ssw/ssw.h:17:0,
from skbio/alignment/_ssw/_ssw_wrapper.c:355:
/usr/lib/gcc/i686-linux-gnu/4.6/include/emmintrin.h:32:3: error: #error "SSE2 instruction set not enabled"
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/__multiarray_api.h:1532:1: warning: ‘_import_array’ defined but not used [-Wunused-function]
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/__ufunc_api.h:226:1: warning: ‘_import_umath’ defined but not used [-Wunused-function]
error: command 'gcc' failed with exit status 1
I ran already sudo apt-get update and sudo apt-get upgrade to get the most recent versions of installed software.
My GCC version is:
gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
How can I successfully install the scikit-bio packages for python?
This problem was previously reported by a user with an i686 machine on the scikit-bio issue tracker. The error occurs while compiling SSW, an external C program that is shipped with scikit-bio. The author of SSW recommended passing -msse2 to the compiler to fix the issue.
A fix was merged into the development branch of scikit-bio to include this flag for i686 machines.
If you are installing a release version of scikit-bio, you can specify this flag via CFLAGS on the command line:
CFLAGS=-msse2 pip install scikit-bio
or:
sudo CFLAGS=-msse2 pip install scikit-bio
Alternatively, scikit-bio's setup.py file can be modified to include '-msse2' in SSW's extra_compile_args.
Trying to install Cython on a small VPS running Ubuntu Server. Did
sudo apt-get install gcc
and then
python setup.py install
In the Cython directory, but I get this peculiar error.
running install
running build
running build_py
running build_ext
building 'Cython.Plex.Scanners' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c Cython/Plex/Scanners.c -o build/temp.linux-x86_64-2.6/Cython/Plex/Scanners.o
Cython/Plex/Scanners.c:4:20: error: Python.h: No such file or directory
Cython/Plex/Scanners.c:6:6: error: #error Python headers needed to compile C extensions, please install development version of Python.
error: command 'gcc' failed with exit status 1
Why should I need a 'development version of Python'? Running Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41). Thanks!
You need the developer version of Python - i.e. the Python header files (Python.h)
sudo apt-get install python-dev
You need the headers included in the development version of Python, i.e. python.h. It should be packaged in Ubuntu as python-dev.