Unable to load psycopg2

I'm using PyCharm community edition, Windows 8.1 with Anaconda Python 2.x 64-bit
I'm trying to debug an app which is Django.

My run config
Script: C:\Users\Josh\dev\python\mysample\manage.py
Parameters: runserver

I'm getting this error in base.py

    raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)

I am have psycopg2 installed and am able to import it from python outside of pycharm.  My app runs fine there.
I have my anaconda python in my path.  When looking at parent env in run configurations I see:

Path    C:\anaconda2;C:\anaconda2\DLLs;C:\anaconda2\Scripts;C:\Program Files (x86)\NVIDIA...

If I run python console from the tools menu in pycharm, I am unable import the psycopg2 library.

What gives?
2 comments
Comment actions Permalink
Hi! Does your run configuration work correctly in run mode (not in debugger)?
Did you check installation of psycopg2 on the your project interpreter?
Also can you run manage.py runserver outside of PyCharm?
0
Comment actions Permalink
I've fixed it.  It wasn't pycharm related.  Strangely, it all worked from the command line from bash, but not from the windows command line.  Reinstalling psycopg2 from the windows command line (rather than bash) made it possible to import the lib from python.  
It doesnt make sense to me why that was the case, but that's what fixed it.
0

Please sign in to leave a comment.