1

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?

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Mr How
  • 255
  • 2
  • 10

1 Answers1

2

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