In attempting to solve a package management issue here, I learned I may have issues with the way I'm using PYTHONPATH
to access packages outside of the site-packages directory.
I receive an import error when attempting to import modules from a package (say wxPython
) from its versioned directory folder name (i.e. wx-2.8-msw-unicode
) when said directory is not in the python site-packages directory.
To recreate the issue: Create a directory outside of the python directory, say C:\foo
. Download wxPython
, and place it in that directory (giving C:\foo\wx-2.8-msw-unicode
). Add more if you like. Add the directory C:\foo
to your PYTHONPATH
environment variable. Open a new python interactive shell and run
import sys
for i in sys.paths:
print i
to verify that the path is there (which it is), then
import wx
I receive an Import Error. What am I doing wrong? Is this behavior correct?