I'm trying to install a python package using easy_install but it keeps saying that a file is missing. I have tried 'sudo apt-get install python2.7-dev'
I'm on xubuntu.
sudo easy_install autopy
Searching for autopy
Reading https://pypi.python.org/simple/autopy/
Best match: autopy 0.51
Downloading https://pypi.python.org/packages/source/a/autopy/autopy-0.51.tar.gz#md5=b92055aa2a3712a9c3b4c874014b450e
Processing autopy-0.51.tar.gz
Writing /tmp/easy_install-lFRYYC/autopy-0.51/setup.cfg
Running autopy-0.51/setup.py -q bdist_egg --dist-dir /tmp/easy_install-lFRYYC/autopy-0.51/egg-dist-tmp-WC7CUY
src/snprintf.c: In function ‘portable_vsnprintf’:
src/snprintf.c:569:19: warning: variable ‘starting_p’ set but not used [-Wunused-but-set-variable]
const char *starting_p;
^
src/png_io.c:3:17: fatal error: png.h: No such file or directory
#include <png.h>
^
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Related
I'm trying to make a streamlit app working with primer3 and the python file works fine on my PC. However I'm having trouble installing primer3-py on my ec2 server running Linux system.
The command that I run is:
python3 setup.py build_ext --inplace
It gets an error like this:
primer3/src/primerdesign_py.c:30:13: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
Just in case, I tried to run pip3 install primer3-py directly and led to the same error. It seemed that gcc is part of Cython, which I've already succeeded in installing.
I would be really grateful for any help! Thank you!
pip install pyaudio failed on MacOS with error src/_portaudiomodule.c:27:19: fatal error: stdio.h: No such file or directory #include <stdio.h>
After doing some research I ran the following commands:
1/ export CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/
2/ pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
But got errors /usr/local/include/portaudio.h:114:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes] and error: command 'gcc' failed with exit status 1 instead.
It seems upgrading to MacOS Catalina messed up my Xcode Developer Tools C headers but am not able to resolve it.
i was able to solve this by copying portaudio.h from /usr/local/include/ to anaconda3/include.
I have a newish Slackware 14.1 64-bit install (Python 2.7.5), and am trying to install pygraphviz via pip.
When I run:
pip install pygraphviz
however, I get the following error:
In file included from /usr/include/python2.7/Python.h:8:0,
from pygraphviz/graphviz_wrap.c:124:
/usr/include/python2.7/pyconfig.h:6:25: fatal error: pyconfig-64.h: No such file or directory
#include "pyconfig-64.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
The referenced pyconfig.h file is:
#include <bits/wordsize.h>
#if __WORDSIZE == 32
#include "pyconfig-32.h"
#elif __WORDSIZE == 64
#include "pyconfig-64.h"
#else
#error "Unknown word size"
#endif
Looking around, there is a lot of info for missing a pyconfig.h file, but not the 64 variant, and I'm struggling to find the package to install to take care of this. I tried to use rpm2tgz and the python-devel rpm for 2.7.5 from Fedora, but it didn't take care of the issue. Also, as I'm running slack, a yum or apt-get command isn't a valid solution, I need to know where I can find the actual package.
to solve problem you need to install python dev pakege
sudo apt-get install python2.7-dev
I am trying to install adns-python using linux and had to recompile adns with some special options, so I can't seem to use easy_install <tarball> as I normally would
(py26_default)[mpenning#localhost src]$ easy_install adns-python-1.2.1.tar.gz
Processing adns-python-1.2.1.tar.gz
Running adns-python-1.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-9cVl4i/adns-python-1.2.1/egg-dist-tmp-vvO8Ms
adnsmodule.c:10:18: error: adns.h: No such file or directory
adnsmodule.c:31: error: expected specifier-qualifier-list before âadns_stateâ
adns.h is installed under /opt/adns/include/adns.h; how can I make easy_install install with a local installation of adns?
EDIT
After the attempt below, I still find an ld error, even though I exported LD_LIBRARY_PATH...
(py26_default)[mpenning#localhost src]$ ls /opt/adns/lib/
libadns.a libadns.so libadns.so.1 libadns.so.1.2
(py26_default)[mpenning#localhost src]$ export LD_LIBRARY_PATH=/opt/adns/lib
(py26_default)[mpenning#localhost src]$ C_INCLUDE_PATH=/opt/adns/include easy_install ./adns-python-1.2.1.tar.gz
Processing adns-python-1.2.1.tar.gz
Running adns-python-1.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-x68T9f/adns-python-1.2.1/egg-dist-tmp-MpCzMP
/usr/bin/ld: cannot find -ladns
collect2: ld returned 1 exit status
error: Setup script exited with error: command 'gcc' failed with exit status 1
(py26_default)[mpenning#localhost src]$
LD_LIBRARY_PATH is used to find a shared library at runtime (when an executable is run), not during linking.
To build the extension, unpack the tarball and run:
python setup.py build_ext -I/opt/adns/include -L/opt/adns/lib -R/opt/adns/lib
To install:
python setup.py install
You could specify build_ext options in setup.cfg:
[build_ext]
include_dirs=/opt/adns/include
library_dirs=/opt/adns/lib
rpath=/opt/adns/lib
in this case you could run easy_install directly.
Please try like this
INCLUDE_PATH=/opt/adns/include easy_install adns-python-1.2.1.tar.gz
if it is not working please try with CPLUS_INCLUDE_PATH or C_INCLUDE_PATH
pycurl installs fine on python2.6 but i get the following error when I try to install in on 2.7 via easy_install on maverick
$ sudo easy_install pycurl
install_dir /usr/local/lib/python2.7/dist-packages/
Searching for pycurl
Reading http://pypi.python.org/simple/pycurl/
Reading http://pycurl.sourceforge.net/
Reading http://pycurl.sourceforge.net/download/
Best match: pycurl 7.19.0
Downloading http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz
Processing pycurl-7.19.0.tar.gz
Running pycurl-7.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-PFzxzf/pycurl-7.19.0/egg-dist-tmp-oAFjdV
Using curl-config (libcurl 7.21.0)
src/pycurl.c:42: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
Is 2.7 not compatible with pycurl?
sudo apt-get install python-dev
This installs the Python development package that is required and fixes the problem of the missing header file.
(Please read the comment by Corey)