Python script shows different pythonpath
- by Bird Jaguar IV
Attempting to run runsnake gives
ImportError: No module named wx
Opening an ipython or python session seems to work fine:
>>> import wx
>>> import sys
>>> print [p for p in sys.path if 'wx' in p]
['/usr/local/lib/wxPython-2.9.4.0/lib/python2.7/site-packages', '/usr/local/lib/wxPython-2.9.4.0/lib/python2.7/site-packages/wx-2.9.4-osx_cocoa', '/usr/local/lib/wxPython-2.9.4.0/lib/python2.7/site-packages/wx-2.9.1-osx_cocoa/tools']
as does putting that code in a script and calling python script.py. But putting that code at the beginning of runsnake.py prints an empty list (printing the whole sys.path prints a path quite different from my $PYTHONPATH).
Why would it be different, and how to I get it to recognize wxPython?