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" 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 I get:

C:\python_virtualenvs\cherrypy_jinja2\Scripts\python.exe C:/MyProject/
Traceback (most recent call last):
  File "C:\MyProject\", 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
Comment actions Permalink
What's your sys.path? Open a Python interactive console in PyCharm, and run:
>>> import sys
>>> sys.path

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

Please sign in to leave a comment.