Ubuntu, fatal error: Python.h: No such file or directory #include <Python.h>
Question:
When I try to install psycopg2 the error appears
fatal error: Python.h: No such file or directory
#include <Python.h>
Because, there is a search for this file along the path /usr/include/python3.8
But this file is located in the path /usr/local/include/python3.8/Python.x
How to solve this problem?? Is Python installed in the wrong directory?
Answers:
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
When I try to install psycopg2 the error appears
fatal error: Python.h: No such file or directory
#include <Python.h>
Because, there is a search for this file along the path /usr/include/python3.8
But this file is located in the path /usr/local/include/python3.8/Python.x
How to solve this problem?? Is Python installed in the wrong directory?
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