PyCharm, Windows 7 and virtualenv

I'm using PyCharm 2.6.3 on Windows 7.  I have a virtualenv environment that has cherrypy and jinja2 in added to a basic Python 2.7.3.  

I can activate my virtualenv, go to my project's directory and run "python site.py" and my cherrypy server starts up just fine.

I open this directory with PyCharm and then go into settings and add the interpreter at c:\python_virtualenvs\cherrypy_jinja2 (my virtualenv that runs correctly - the choice popped up on its own without need to browse to it).  The Packages and Paths seem to look find for the interpreter after it was added.

When I try to run site.py I get:

C:\python_virtualenvs\cherrypy_jinja2\Scripts\python.exe C:/MyProject/site.py
Traceback (most recent call last):
  File "C:\MyProject\site.py", line 1, in <module>
    import socket
ImportError: No module named socket

Process finished with exit code 1

This is making little sense to me.  Any suggestions on how to get past this would be greatly appreciated.
1 comment
What's your sys.path? Open a Python interactive console in PyCharm, and run:
>>> import sys
>>> sys.path
prettyPrint();
Where is the socket module located in your virtualenv? Run your virtualenv (!) Python interpreter from the Windows command line:
> cd path\to\virtualenv
> Scripts\python.exe
>>> import socket
>>> socket
prettyPrint();
0

Please sign in to leave a comment.