1
resposta

Problemas na instalação do psycopg2

ERROR: Command errored out with exit status 1: command: /Users/leonardoandre/ProjetoAlura/venvAlura/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/priva te/var/folders/rk/53135bjx5vd82f4n2cccb9h80000gn/T/pip-install-4mh614c2/psycopg2/setup.py'"'"'; file='"'"'/private/var/folders/rk /53135bjx5vd82f4n2cccb9h80000gn/T/pip-install-4mh614c2/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);

.... e continua

Error: pg_config executable not found.

pg_config is required to build psycopg2 from source.  Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.

For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

1 resposta

Oi Leonardo, tudo bem com você?

Dentro do ambiente virtual, explicite a versão 3 do pip:

pip3 install psycopg2 

Se você utiliza o Linux, adicione as dependências abaixo e após isso, tente executar o comando de instalação do psycopg2 novamente:

sudo apt-get install libpq-dev python-dev

Qualquer dúvida estou à disposição. Abraços e bons estudos!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software