fastmonkeys / stellar

Fast database snapshot and restore tool for development
MIT License
3.86k stars 119 forks source link

"pip install psycopg2" doesn't solve "Python library psycopg2 is required for PostreSQL support." #58

Closed leonelgalan closed 8 years ago

leonelgalan commented 8 years ago

I installed psycopg2 after being prompted to by stellar, but stellar init keeps failing even after installing psycopg2. I'm on a Mac and python was installed through Anaconda.

Command Line

$ stellar init
Please enter the url for your database.

For example:
PostgreSQL: postgresql://localhost:5432/
MySQL: mysql+pymysql://root@localhost/: postgresql://localhost:5432/
Python library psycopg2 is required for PostreSQL support.
You can install it with pip:
pip install psycopg2

$ pip install psycopg2
Requirement already satisfied (use --upgrade to upgrade): psycopg2 in /Users/leonelgalan/anaconda/lib/python2.7/site-packages

$ which pip
/Users/leonelgalan/anaconda/bin/pip

$ which python
/Users/leonelgalan/anaconda/bin/python

$ stellar init
Please enter the url for your database.

For example:
PostgreSQL: postgresql://localhost:5432/
MySQL: mysql+pymysql://root@localhost/: postgresql://localhost:5432/
Python library psycopg2 is required for PostreSQL support.
You can install it with pip:
pip install psycopg2
leonelgalan commented 8 years ago

Sorry for the "noise", just typing questions helps finding a solution:

If you are using Anaconda, like me, install psycopg2 using conda install psycopg2 rather than pip install psycopg2

ChristianVermeulen commented 7 years ago

I'm having the same problem, however I'm not using anaconda, but just PIP, even installed it for this purpose...

screenshot 2016-10-24 11 21 29

Teemu commented 7 years ago

There's a known issue that the "helpful" error message hides the underlying error, try doing the following:

python -c "import psycopg2"
mszczepanczyk commented 5 years ago

Had to install psycopg2 globally. Ubuntu: apt-get install python-psycopg2