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.
Related
I am trying to install a package called PySIT to be run with Python, and have followed the instructions on this install page (https://pysit.readthedocs.io/en/latest/install.html) using pip on my terminal to install PySIT.
I am using macOS Catalina for this, and have Anaconda installed on my computer.
This is the output I get on my terminal when I run the command: python setup.py install
gcc-8 -fno-strict-aliasing -I/Users/KBrindha/anaconda2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/KBrindha/anaconda2/lib/python2.7/site-packages/numpy/core/include -Ipysit/solvers/fd_tools -I/Users/KBrindha/anaconda2/include/python2.7 -c pysit/solvers/constant_density_acoustic/time/scalar/solvers_wrap.cxx -o build/temp.macosx-10.6-x86_64-2.7/pysit/solvers/constant_density_acoustic/time/scalar/solvers_wrap.o -O3 -fopenmp -ffast-math
unable to execute 'gcc-8': No such file or directory
error: command 'gcc-8' failed with exit status 1
Any help on how to bypass this issue or install gcc-8 would be appreciated.
For further information, I have Xcode and Xcode Command Line Tools installed in my computer.
I also have "just" gcc (not gcc-8) installed at /usr/bin/gcc.
The authors inserted fixed names for compilers right into their setup.py. This is a bug and I recommend to report it.
Meanwhile you can clone the repository or download source code, extract it, edit setup.py and remove or replace these fixed names. Then build with the command pip install .
I am trying to install python-mcrypt-1.1 with below command
pip install http://labix.org/download/python-mcrypt/python-mcrypt-1.1.tar.gz
but i am getting below error i have tried with sudo permission as well but not able to install and getting below error
running install
running build
running build_ext
building 'mcrypt' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DVERSION="1.1" -I/usr/include/python2.7 -c mcrypt.c -o build/temp.linux-x86_64-2.7/mcrypt.o
mcrypt.c:23:20: fatal error: mcrypt.h: No such file or directory
#include <mcrypt.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
python-mcrypt is a Python interface to the mcrypt library. You have to install mcrypt first.
found the solution for this issue .
For mcrypt.h, libmcrypt-dev needs to install by following command
sudo apt-get install libmcrypt-dev
after installing with above command python-crypt got install successfully with below command
pip install http://labix.org/download/python-mcrypt/python-mcrypt-1.1.tar.gz
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.
I am trying to install PyBluez-0.18 on my Linux Mint 15 machine, but got an error message during the installation process. I tried searching online to see if others might have encountered this problem, but I could not find any.
I list the command I tried to execute, along with the error message I received. Could someone tell me what I am doing wrong, and what I need to do to reso
tri108354#prtgc004-Latitude-E6320 ~/Downloads/PyBluez-0.18 $ python setup.py install
running install
running build
running build_py
running build_ext
building 'bluetooth._bluetooth' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/tri108354/anaconda/include/python2.7 -c bluez/btmodule.c -o build/temp.linux-i686-2.7/bluez/btmodule.o
In file included from bluez/btmodule.c:20:0:
bluez/btmodule.h:5:33: fatal error: bluetooth/bluetooth.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
You need to install libbluetooth-dev package for compiling your code
sudo apt-get install libbluetooth-dev
That should install the bluetooth header files.
Question
How do I install SSL for Python 2.5 on Debian?
I have tried:
sudo easy_install ssl
But getting:
$ python setup.py build
looking for /usr/include/openssl/ssl.h
looking for /usr/include/krb5.h
running build
running build_py
running build_ext
building 'ssl._ssl2' extension
creating build/temp.linux-i686-2.5
creating build/temp.linux-i686-2.5/ssl
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I./ssl/2.5.1 -I/usr/include/python2.5 -c ssl/_ssl2.c -o build/temp.linux-i686-2.5/ssl/_ssl2.o
In file included from ssl/_ssl2.c:75:
./ssl/2.5.1/socketmodule.h:45:33: error: bluetooth/bluetooth.h: No such file or directory
./ssl/2.5.1/socketmodule.h:46:30: error: bluetooth/rfcomm.h: No such file or directory
./ssl/2.5.1/socketmodule.h:47:29: error: bluetooth/l2cap.h: No such file or directory
./ssl/2.5.1/socketmodule.h:48:27: error: bluetooth/sco.h: No such file or directory
In file included from ssl/_ssl2.c:75:
./ssl/2.5.1/socketmodule.h:98: error: field ‘bt_l2’ has incomplete type
./ssl/2.5.1/socketmodule.h:99: error: field ‘bt_rc’ has incomplete type
./ssl/2.5.1/socketmodule.h:100: error: field ‘bt_sco’ has incomplete type
error: command 'gcc' failed with exit status 1
Solution
sudo apt-get install libbluetooth-dev
sudo rm /usr/lib/python2.5/site-packages/ssl/__init__.pyc
For reference, you must install libbluetooth-dev.
In fact, you shouldn't compile your own version of python ssl module for several reasons:
you won't get automatic security updates of your python ssl module;
you won't get smooth upgrade path if you decide to upgrade Debian system on your server.
The best way to obtain python ssl module is to install it from official Debian repositories using apt-get:
apt-get install python-openssl
Hope this helps.