4

While isntaling binaryanalysis Iv got an error ImportError: No module named psycopg2 but I have installed it but its only avalible for python 3.5. How I can install it for python2.7 ?

Python 3.5

$ python3.5
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>> exit
Use exit()

Python 2.7

$ python2.7
Python 2.7.12 (default, Nov 20 2017, 18:23:56) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named psycopg2
>>> 

Edit:

$ pip install psycopg2 
Requirement already satisfied: psycopg2 in /usr/local/lib/python3.5/dist-packages
5
  • Do you have pip installed for python 2.7? Commented Jan 8, 2018 at 2:59
  • Probably not, I dont know, how I can check ? Commented Jan 8, 2018 at 3:01
  • What OS or distro do you use? Can you run pip2 --version or pip27 --version? Commented Jan 8, 2018 at 3:02
  • Im on ubuntu 16.04 and no pip2 its not instaled Commented Jan 8, 2018 at 3:04
  • Oh yes $ pip2 install psycopg2 it took me some time, can you post your anwer I will accept it, tnx Commented Jan 8, 2018 at 3:10

1 Answer 1

4

Try this

pip install psycopg2-binary

I did this for Python 2.7, not sure if it works for Python 3.6

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.