Z
Z
zlodiak2019-04-05 17:49:12
Python
zlodiak, 2019-04-05 17:49:12

Why does psycopg2 swear on python3.5?

On my machine the default is python3.5. I'm trying to install a package that would allow writing to a postgres db.

[email protected] ~ $ python --version
Python 3.5.2
[email protected] ~ $ pip install psycopg2
/home/kalinin/.local/lib/python2.7/site-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting psycopg2
  Using cached https://files.pythonhosted.org/packages/c7/ca/75236b17f1b951950ffc55d657c5aa408d3d0327a1b6c4c0f7cb16ef7e7b/psycopg2-2.8.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named setuptools
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-9elJ0Q/psycopg2/

As you can see, there are messages in the console that say that I need to change the python version from version 2 to version 3. I don’t understand this because I already have version 3 in my system. Please tell me how to be

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bbkmzzzz, 2019-04-05
@zlodiak

pip3 install psycopg2

A
Alexander, 2019-04-05
@NeiroNx

most likely pip refers to 2.7, try this
python3 -m pip install psycopg2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question