@che_aa

Не качается psycopg2 на python3.9?

Почему не качается psycopg2 на python3.9?
Что я делаю:

$python3.9 -m pip install psycopg2
Collecting psycopg2
Using cached https://files.pythonhosted.org/packages/33/ed/7943...
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 376, in prepare_files
discovered_reqs.extend(self._prepare_file(
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 412, in run_egg_info
self.setup_py, self.name,
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 387, in setup_py
import setuptools # noqa
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 664, in _load_unlocked
File "", line 627, in _load_backward_compatible
File "", line 259, in load_module
File "/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/__init__.py", line 14, in
from setuptools.dist import Distribution, Feature
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 664, in _load_unlocked
File "", line 627, in _load_backward_compatible
File "", line 259, in load_module
File "/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/dist.py", line 24, in
from setuptools.depends import Require
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 664, in _load_unlocked
File "", line 627, in _load_backward_compatible
File "", line 259, in load_module
File "/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/depends.py", line 7, in
from .py33compat import Bytecode
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 664, in _load_unlocked
File "", line 627, in _load_backward_compatible
File "", line 259, in load_module
File "/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/py33compat.py", line 54, in
unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape)
AttributeError: 'HTMLParser' object has no attribute 'unescape'


ос ubuntu18.04

Что я делал чтобы это починить и не помогло:
pip3 install --upgrade pip
pip3 install --upgrade distlib
pip3 install --upgrade setuptools
  • Вопрос задан
  • 162 просмотра
Решения вопроса 1
@che_aa Автор вопроса
В общем, помогло это:
sudo apt install libpq-dev python3.9-dev
python3.9 -m pip install psycopg2-binary
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 2
hottabxp
@hottabxp
Сначала мы жили бедно, а потом нас обокрали..
Попробуйте так: python3.9 -m pip install psycopg2-binary
Ответ написан
@albert-gaynullin
pip install psycopg2-binary

это работает на vps с ubuntu
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы