I tried to install pandas on a remote server, but I got the following error:
pandas/_libs/tslibs/strptime.c:4:20: fatal error: Python.h: No such
file or directory #include "Python.h"
But, when I tried to locate, I was able to find it in :
python/Python-3.7.1/Include/Python.h
gcc couldn't recognize the path. How to solve this problem without using sudo install?
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 virtual env for python, and trying to install some packages in the virtual-env:
sudo /Users/edamame/Library/python_virenv/bin/pip install matplotlib
Then I got the following error:
:
:
clang: warning: -framework Tcl: 'linker' input unused
clang: warning: -framework Tk: 'linker' input unused
In file included from src/_tkagg.cpp:28:
/usr/local/include/tk.h:71:13: fatal error: 'X11/Xlib.h' file not found
# include <X11/Xlib.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
I am on Mac El-Captain, and I have:
edamame$ locate Xlib.h
WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.
Any idea how I can fix this problem? Thanks!
You should either install the development files for X11 (from memory: libx11-dev), or if they are already installed, add the X11 directory to your include search path.
You can use locate Xlib.h to figure out if the files are already there. Use the -I compiler option to add directories to your search path.
I'm trying to install psycopg2 for use with Django. I'm using a virtualenv and when I try to install psycopg2 I get an error which says:
In file included from psycopg/psycopgmodule.c:27:
./psycopg/psycopg.h:30:10: error: 'Python.h' file not found with <angled> include; use "quotes" instead
#include <Python.h>
^~~~~~~~~~
"Python.h"
In file included from psycopg/psycopgmodule.c:27:
In file included from ./psycopg/psycopg.h:30:
psycopg/Python.h:29:10: fatal error: 'structmember.h' file not found
#include <structmember.h>
^
2 errors generated.
error: command 'clang' failed with exit status 1
I found a few threads online that seemed to suggest that the solution to this problem is to install python-dev. Unfortunately, I've only found it available for apt-get and yum. It's not available for homebrew or macports as for as I know. Can anyone help me figure out either why the installation fails or how I can get psycopg2? Thanks!
EDIT: I'm using a virtualenv and using the postgres app. I have the XCode command line tools installed already.
So it turns out I was wrong about the cause of the problem. It was not because I didn't have the Python headers, it was because I had somehow deleted them all from the homebrew python directory. After some chatting on Freenode's Python channel, a user helped me identify the problem. There were only three files in
/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/include/python2.7
So I ran
brew uninstall python
brew install python
which reinstalled the headers and fixed the problem!
When I try to install psycopg2, using PIP in a virtual environment, on Windows 8 I get the following error:
c:\python27\include\pyconfig.h(231) : fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\BIN\\amd64\\cl.exe' failed with exit status 2
I had previously had this error:
error: Unable to find vcvarsall.bat
So I followed the various answers in this question:
and managed to get rid of
error: Unable to find vcvarsall.bat
but have this new one to contend with
any ideas?
thanks
According to the psycopg website, you're supposed to install it using the Windows port:
http://www.stickpeople.com/projects/python/win-psycopg/
I'm guessing you'll need a version of Visual Studio installed for pip to be able to compile the headers correctly.