Do you have PostgreSQL installed ? if yes, check the pg_config location in :
Then, update the PATH :
Otherwise, you can try :
sudo apt install libpq-dev python3-dev sudo apt install build-essential