2
respostas

Erro ao tentar instalar psycopg2

Boa tarde,

estou recebendo este erro ao tentar instalar o psycopg2 com o comando pip install psycopg2

ERROR: Command errored out with exit status 1: command: 'C:\Users\marcelo.carvalho\Desktop\aplicacao\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\marcelo.carvalho\\AppData\\Local\\Temp\\pip-install-wvt1vd2s\\psycopg2_3ff304ae9942493399a93113319a18bd\\setup.py'"'"'; __file__='"'"'C:\\Users\\marcelo.carvalho\\AppData\\Local\\Temp\\pip-install-wvt1vd2s\\psycopg2_3ff304ae9942493399a93113319a18bd\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\marcelo.carvalho\AppData\Local\Temp\pip-pip-egg-info-mzmssr6j' cwd: C:\Users\marcelo.carvalho\AppData\Local\Temp\pip-install-wvt1vd2s\psycopg2_3ff304ae9942493399a93113319a18bd\ Complete output (39 lines): running egg_info creating C:\Users\marcelo.carvalho\AppData\Local\Temp\pip-pip-egg-info-mzmssr6j\psycopg2.egg-info writing C:\Users\marcelo.carvalho\AppData\Local\Temp\pip-pip-egg-info-mzmssr6j\psycopg2.egg-info\PKG-INFO writing dependency_links to C:\Users\marcelo.carvalho\AppData\Local\Temp\pip-pip-egg-info-mzmssr6j\psycopg2.egg-info\dependency_links.txt writing top-level names to C:\Users\marcelo.carvalho\AppData\Local\Temp\pip-pip-egg-info-mzmssr6j\psycopg2.egg-info\top_level.txt writing manifest file 'C:\Users\marcelo.carvalho\AppData\Local\Temp\pip-pip-egg-info-mzmssr6j\psycopg2.egg-info\SOURCES.txt' Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\marcelo.carvalho\AppData\Local\Temp\pip-install-wvt1vd2s\psycopg2_3ff304ae9942493399a93113319a18bd\setup.py", line 548, in <module> setup(name="psycopg2", File "C:\Users\marcelo.carvalho\Desktop\aplicacao\venv\lib\site-packages\setuptools\__init__.py", line 153, in setup return distutils.core.setup(**attrs) File "C:\Users\marcelo.carvalho\AppData\Local\Programs\Python\Python310\lib\distutils\core.py", line 148, in setup dist.run_commands() File "C:\Users\marcelo.carvalho\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 966, in run_commands self.run_command(cmd) File "C:\Users\marcelo.carvalho\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "C:\Users\marcelo.carvalho\Desktop\aplicacao\venv\lib\site-packages\setuptools\command\egg_info.py", line 299, in run self.find_sources() File "C:\Users\marcelo.carvalho\Desktop\aplicacao\venv\lib\site-packages\setuptools\command\egg_info.py", line 306, in find_sources mm.run() File "C:\Users\marcelo.carvalho\Desktop\aplicacao\venv\lib\site-packages\setuptools\command\egg_info.py", line 541, in run self.add_defaults() File "C:\Users\marcelo.carvalho\Desktop\aplicacao\venv\lib\site-packages\setuptools\command\egg_info.py", line 578, in add_defaults sdist.add_defaults(self) File "C:\Users\marcelo.carvalho\AppData\Local\Programs\Python\Python310\lib\distutils\command\sdist.py", line 228, in add_defaults self._add_defaults_ext() File "C:\Users\marcelo.carvalho\AppData\Local\Programs\Python\Python310\lib\distutils\command\sdist.py", line 311, in _add_defaults_ext build_ext = self.get_finalized_command('build_ext') File "C:\Users\marcelo.carvalho\AppData\Local\Programs\Python\Python310\lib\distutils\cmd.py", line 299, in get_finalized_command cmd_obj.ensure_finalized() File "C:\Users\marcelo.carvalho\AppData\Local\Programs\Python\Python310\lib\distutils\cmd.py", line 107, in ensure_finalized self.finalize_options() File "C:\Users\marcelo.carvalho\AppData\Local\Temp\pip-install-wvt1vd2s\psycopg2_3ff304ae9942493399a93113319a18bd\setup.py", line 380, in finalize_options for token in pg_config_helper.query("ldflags").split(): File "C:\Users\marcelo.carvalho\AppData\Local\Temp\pip-install-wvt1vd2s\psycopg2_3ff304ae9942493399a93113319a18bd\setup.py", line 123, in query result = result.decode('ascii') UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 1: ordinal not in range(128) Já atualizei o path do Windows, como foi orientado em uma resposta anterior aqui neste fórum, mas o problema persiste. Agradeço pela atenção.

2 respostas

Ainda tinha um restinho do erro que não coube na pergunta:

----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/aa/8a/7c80e7e44fb1b4277e89bd9ca509aefdd4dd1b2c547c6f293afe9f7ffd04/psycopg2-2.9.1.tar.gz#sha256=de5303a6f1d0a7a34b9d40e4d3bef684ccc44a49bbe3eb85e3c0bffb4a131b7c (from https://pypi.org/simple/psycopg2/) (requires-python:>=3.6). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Obrigado.

O post foi fechado por inatividade após 6 meses. Para continuar o assunto, recomendamos criar um novo tópico. Bons Estudos!