Ошибка при установке psycopg2 через pip

При попытке установки psycopg2 через pip выдает следующую ошибку:

Collecting psycopg2
  Using cached psycopg2-2.9.1.tar.gz (379 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\korti\Documents\ProjectLog\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\korti\\AppData\\Local\\Temp\\pip-install-1s0xc6c6\\psycopg2_9e87feec0b8f4d0e8cfcae2fd5ab2321\\setup.py'"'"'; __file__='"'"'C:\\Users\\korti\\AppData\\Local\\Temp\\pip-install-1s0xc6c6\\psycopg2_9e87feec0b8f4d0e8cfcae2fd5ab2321\\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\korti\AppData\Local\Temp\pip-pip-egg-info-g5t70e0f'
       cwd: C:\Users\korti\AppData\Local\Temp\pip-install-1s0xc6c6\psycopg2_9e87feec0b8f4d0e8cfcae2fd5ab2321\
  Complete output (39 lines):
  running egg_info
  creating C:\Users\korti\AppData\Local\Temp\pip-pip-egg-info-g5t70e0f\psycopg2.egg-info
  writing C:\Users\korti\AppData\Local\Temp\pip-pip-egg-info-g5t70e0f\psycopg2.egg-info\PKG-INFO
  writing dependency_links to C:\Users\korti\AppData\Local\Temp\pip-pip-egg-info-g5t70e0f\psycopg2.egg-info\dependency_links.txt
  writing top-level names to C:\Users\korti\AppData\Local\Temp\pip-pip-egg-info-g5t70e0f\psycopg2.egg-info\top_level.txt
  writing manifest file 'C:\Users\korti\AppData\Local\Temp\pip-pip-egg-info-g5t70e0f\psycopg2.egg-info\SOURCES.txt'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\korti\AppData\Local\Temp\pip-install-1s0xc6c6\psycopg2_9e87feec0b8f4d0e8cfcae2fd5ab2321\setup.py", line 548, in <module>
      setup(name="psycopg2",
    File "C:\Users\korti\Documents\ProjectLog\venv\lib\site-packages\setuptools\__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\korti\AppData\Local\Programs\Python\Python310\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "C:\Users\korti\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "C:\Users\korti\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\korti\Documents\ProjectLog\venv\lib\site-packages\setuptools\command\egg_info.py", line 299, in run
      self.find_sources()
    File "C:\Users\korti\Documents\ProjectLog\venv\lib\site-packages\setuptools\command\egg_info.py", line 306, in find_sources
      mm.run()
    File "C:\Users\korti\Documents\ProjectLog\venv\lib\site-packages\setuptools\command\egg_info.py", line 541, in run
      self.add_defaults()
    File "C:\Users\korti\Documents\ProjectLog\venv\lib\site-packages\setuptools\command\egg_info.py", line 578, in add_defaults
      sdist.add_defaults(self)
    File "C:\Users\korti\AppData\Local\Programs\Python\Python310\lib\distutils\command\sdist.py", line 228, in add_defaults
      self._add_defaults_ext()
    File "C:\Users\korti\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\korti\AppData\Local\Programs\Python\Python310\lib\distutils\cmd.py", line 299, in get_finalized_command
      cmd_obj.ensure_finalized()
    File "C:\Users\korti\AppData\Local\Programs\Python\Python310\lib\distutils\cmd.py", line 107, in ensure_finalized
      self.finalize_options()
    File "C:\Users\korti\AppData\Local\Temp\pip-install-1s0xc6c6\psycopg2_9e87feec0b8f4d0e8cfcae2fd5ab2321\setup.py", line 380, in finalize_options
      for token in pg_config_helper.query("ldflags").split():
    File "C:\Users\korti\AppData\Local\Temp\pip-install-1s0xc6c6\psycopg2_9e87feec0b8f4d0e8cfcae2fd5ab2321\setup.py", line 123, in query
      result = result.decode('ascii')
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xed in position 0: ordinal not in range(128)
  ----------------------------------------
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.
  Using cached psycopg2-2.9.tar.gz (379 kB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\korti\Documents\ProjectLog\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\korti\\AppData\\Local\\Temp\\pip-install-1s0xc6c6\\psycopg2_53abe997ee8248ffbfdcb51c3f69f85b\\setup.py'"'"'; __file__='"'"'C:\\Users\\korti\\AppData\\Local\\Temp\\pip-install-1s0xc6c6\\psycopg2_53abe997ee8248ffbfdcb51c3f69f85b\\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\korti\AppData\Local\Temp\pip-pip-egg-info-lv039b7p'
       cwd: C:\Users\korti\AppData\Local\Temp\pip-install-1s0xc6c6\psycopg2_53abe997ee8248ffbfdcb51c3f69f85b\
  Complete output (39 lines):
  running egg_info
  creating C:\Users\korti\AppData\Local\Temp\pip-pip-egg-info-lv039b7p\psycopg2.egg-info
  writing C:\Users\korti\AppData\Local\Temp\pip-pip-egg-info-lv039b7p\psycopg2.egg-info\PKG-INFO
  writing dependency_links to C:\Users\korti\AppData\Local\Temp\pip-pip-egg-info-lv039b7p\psycopg2.egg-info\dependency_links.txt
  writing top-level names to C:\Users\korti\AppData\Local\Temp\pip-pip-egg-info-lv039b7p\psycopg2.egg-info\top_level.txt
  writing manifest file 'C:\Users\korti\AppData\Local\Temp\pip-pip-egg-info-lv039b7p\psycopg2.egg-info\SOURCES.txt'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\korti\AppData\Local\Temp\pip-install-1s0xc6c6\psycopg2_53abe997ee8248ffbfdcb51c3f69f85b\setup.py", line 548, in <module>
      setup(name="psycopg2",
    File "C:\Users\korti\Documents\ProjectLog\venv\lib\site-packages\setuptools\__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\korti\AppData\Local\Programs\Python\Python310\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "C:\Users\korti\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "C:\Users\korti\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\korti\Documents\ProjectLog\venv\lib\site-packages\setuptools\command\egg_info.py", line 299, in run
      self.find_sources()
    File "C:\Users\korti\Documents\ProjectLog\venv\lib\site-packages\setuptools\command\egg_info.py", line 306, in find_sources
      mm.run()
    File "C:\Users\korti\Documents\ProjectLog\venv\lib\site-packages\setuptools\command\egg_info.py", line 541, in run
      self.add_defaults()
    File "C:\Users\korti\Documents\ProjectLog\venv\lib\site-packages\setuptools\command\egg_info.py", line 578, in add_defaults
      sdist.add_defaults(self)
    File "C:\Users\korti\AppData\Local\Programs\Python\Python310\lib\distutils\command\sdist.py", line 228, in add_defaults
      self._add_defaults_ext()
    File "C:\Users\korti\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\korti\AppData\Local\Programs\Python\Python310\lib\distutils\cmd.py", line 299, in get_finalized_command
      cmd_obj.ensure_finalized()
    File "C:\Users\korti\AppData\Local\Programs\Python\Python310\lib\distutils\cmd.py", line 107, in ensure_finalized
      self.finalize_options()
    File "C:\Users\korti\AppData\Local\Temp\pip-install-1s0xc6c6\psycopg2_53abe997ee8248ffbfdcb51c3f69f85b\setup.py", line 380, in finalize_options
      for token in pg_config_helper.query("ldflags").split():
    File "C:\Users\korti\AppData\Local\Temp\pip-install-1s0xc6c6\psycopg2_53abe997ee8248ffbfdcb51c3f69f85b\setup.py", line 123, in query
      result = result.decode('ascii')
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xed in position 0: ordinal not in range(128)
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/6c/79/6df8af2405e2aa60732c47757453fc7fa4af5c90a1796b3392ef892d3a52/psycopg2-2.9.tar.gz#sha256=b12073fdf2002e828e5921be2c39ff9c6eab361c5c0bd6c529619fc23677accc (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.
  Using cached psycopg2-2.8.6.tar.gz (383 kB)
  Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for psycopg2, since package 'wheel' is not installed.
Installing collected packages: psycopg2
    Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\korti\Documents\ProjectLog\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\korti\\AppData\\Local\\Temp\\pip-install-1s0xc6c6\\psycopg2_f6aee8672de6453c96c3f79011809309\\setup.py'"'"'; __file__='"'"'C:\\Users\\korti\\AppData\\Local\\Temp\\pip-install-1s0xc6c6\\psycopg2_f6aee8672de6453c96c3f79011809309\\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'"'"'))' install --record 'C:\Users\korti\AppData\Local\Temp\pip-record-htbkbako\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\korti\Documents\ProjectLog\venv\include\site\python3.10\psycopg2'
         cwd: C:\Users\korti\AppData\Local\Temp\pip-install-1s0xc6c6\psycopg2_f6aee8672de6453c96c3f79011809309\
    Complete output (22 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.10
    creating build\lib.win-amd64-3.10\psycopg2
    copying lib\compat.py -> build\lib.win-amd64-3.10\psycopg2
    copying lib\errorcodes.py -> build\lib.win-amd64-3.10\psycopg2
    copying lib\errors.py -> build\lib.win-amd64-3.10\psycopg2
    copying lib\extensions.py -> build\lib.win-amd64-3.10\psycopg2
    copying lib\extras.py -> build\lib.win-amd64-3.10\psycopg2
    copying lib\pool.py -> build\lib.win-amd64-3.10\psycopg2
    copying lib\sql.py -> build\lib.win-amd64-3.10\psycopg2
    copying lib\tz.py -> build\lib.win-amd64-3.10\psycopg2
    copying lib\_ipaddress.py -> build\lib.win-amd64-3.10\psycopg2
    copying lib\_json.py -> build\lib.win-amd64-3.10\psycopg2
    copying lib\_lru_cache.py -> build\lib.win-amd64-3.10\psycopg2
    copying lib\_range.py -> build\lib.win-amd64-3.10\psycopg2
    copying lib\__init__.py -> build\lib.win-amd64-3.10\psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\korti\Documents\ProjectLog\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\korti\\AppData\\Local\\Temp\\pip-install-1s0xc6c6\\psycopg2_f6aee8672de6453c96c3f79011809309\\setup.py'"'"'; __file__='"'"'C:\\Users\\korti\\AppData\\Local\\Temp\\pip-install-1s0xc6c6\\psycopg2_f6aee8672de6453c96c3f79011809309\\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'"'"'))' install --record 'C:\Users\korti\AppData\Local\Temp\pip-record-htbkbako\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\korti\Documents\ProjectLog\venv\include\site\python3.10\psycopg2' Check the logs for full command output.

Ответы (0 шт):