fatal error: Python.h: No such file or directory
I managed to solve this issue and generate the .so file in one command
gcc -shared -o UtilcS.so
-fPIC -I/usr/include/python2.7 -lpython2.7 utilsmodule.c
Ubuntu, fatal error: Python.h: No such file or directory #include Python.h
Its not clear what version of Ubuntu you are using. Assuming it is a fresh install and you don't have these installed. I would suggest you install the following
sudo apt-get install python3 python-dev python3-dev build-essential
Once these are installed then try again installing psycopg2
Python.h: No such file or directory
In your CMakeLists.txt, try adding the following:
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
target_link_libraries(<your exe or lib> ${PYTHON_LIBRARIES})
For details of the commands, run:
cmake --help-module FindPythonLibs
cmake --help-command find_package
cmake --help-command include_directories
cmake --help-command target_link_libraries
Fatal error: Python.h no such file or directory - but python-dev is already installed
I ran ./configure
for mod_wsgi and saw the output checking for python... /usr/bin/python
. When I run locate Python.h
it gives me /usr/include/python3.6m/Python.h
. So it looks like the configuration was finding the wrong version of python. I then ran ./configure --with-python=/usr/bin/python3.6m
as suggested by the mod_wsgi documentation. Now running make
was successful.
I later found out this is the tougher way to install mod_wsgi though. I ended up just following this tecadmin guide which says to run the command sudo apt-get install libapache2-mod-wsgi
. This is what I did and mod_wsgi is now working with apache.
fatal error: Python.h: No such file or directory, python-Levenshtein install
Thanks to Charles, the answer is as follows:
sudo yum install python3-devel
Related Topics
Is There Go Up Line Character? (Opposite of \N)
Strip HTML from Strings in Python
Uninstall Python Built from Source
Post Values from an HTML Form and Access Them in a Flask View
How to Unescape HTML Entities in a String in Python 3.1
Run Multiple Python Scripts Concurrently
How to Terminate Process from Python Using Pid
How to Simulate Html5 Drag and Drop in Selenium Webdriver
How to Remove Script Tags With Beautifulsoup
Selenium.Common.Exceptions.Invalidselectorexception With "Span:Contains('String')"
How to Terminate a Python Subprocess Launched With Shell=True
Imagemagick Not Authorized to Convert Pdf to an Image
Run Interactive Bash With Popen and a Dedicated Tty Python
Calling a Python Script from Command Line Without Typing "Python" First
Set Chrome Browser Binary Through Chromedriver in Python
Convert Columns into Rows With Pandas
Cqlsh Connection Error: 'Ref() Does Not Take Keyword Arguments'