0

I have a problems when try to install

pip install psycopg2

the errors is

Error: pg_config executable not found.

but when I try access pg_config from normal terminal (not in virtualenv mode), I can access the pg_config

Anyone can help ?

Screenshot of pg_config not found on venv, but found on normal terminal mode

Existed Mocha
  • 148
  • 1
  • 7
  • How did you create the `virtualenv`? Where is `pg_config` located? Also you can do `pip install psycopg2-binary` and not involve `pg_config`, with caveats shown [here](https://www.psycopg.org/docs/install.html#quick-install) – Adrian Klaver Oct 10 '20 at 14:44
  • Check if the package is installed in the virtualenv by pip freeze --local or pip list --local. – octopus Oct 10 '20 at 15:11
  • Thanks, I can install pyscopg2 with the binary version, but I still don't understand why when use virtualenv, some of bash command can't be accessed The virtualenv create automaticaly with Pycharm, but when I use python3 -m virtualenv , it still can't be accessed – Existed Mocha Oct 10 '20 at 15:29
  • So, the problems is not with the virtualenv, but with the IDE. I use flatpak version IDE that can't some of bash command, so I switch to non-flatpak, and now is working fine Thanks – Existed Mocha Oct 11 '20 at 02:50
  • 1
    Does this answer your question? [How to install psycopg2 with "pip" on Python?](https://stackoverflow.com/questions/5420789/how-to-install-psycopg2-with-pip-on-python) – dskrvk Nov 23 '21 at 16:42

0 Answers0