1

I have seen this answered but can't find it now. I have tried loading wxglade, PythonToolkit-14.04.04, and another package but I keep getting the message:

 ImportError: No module named wx

I loaded wxPython using the latest installer. I tried Homebrew and got the message wxPython_v.3.0.0 already loaded.

I fixed this a month or so ago by setting the PYTHONPATH but due to a crash I lost the info and now I can't seem to locate the web page that contained the instructions.

I have tried python 2.7 and 3.2 but same error. I'm using a Mac. Can someone please help me.

Thanks

Aleksander Lidtke
  • 2,876
  • 4
  • 29
  • 41
Natsfan
  • 4,093
  • 3
  • 22
  • 29
  • 1
    Do you have `wx` installed still? If so just edit the `PYTHONPATH` to point to them: http://stackoverflow.com/questions/15742779/how-can-i-edit-pythonpath-on-a-mac – Aleksander Lidtke Aug 02 '14 at 22:42
  • Yes I do. When I run 'locate wxpython' i get many lines, one of which is: /usr/local/opt/wxpython How do I set my path to point there? – Natsfan Aug 02 '14 at 23:08
  • I assume wx and wxpython refer to the same thing. I set my PYTHONPATH and my PATH to that /usr/local/opt/wxpython directory but I still get same error... – Natsfan Aug 02 '14 at 23:18
  • when I type: export PYTHONPATH=$PYTHONPATH:/usr/local/Cellar/wxpython/3.0.0.0/lib/python2.7/site-packages/wx-3.0-osx_cocoa that seems to work. Does this make sense? thanks. – Natsfan Aug 02 '14 at 23:33
  • 1
    I never used Python on OSX (I'm a Linux person) but that seems about right. Hey, if it works it works ;) You want to to point to the directory with the `__init__` file for `wx` (and yes, `wx` is just the name of the module). On my windows machine this is `C:\Python27\Lib\site-packages\wx-2.9.4-msw\wx` – Aleksander Lidtke Aug 03 '14 at 07:44
  • usually you don't add a Python package directly to the PATH or PYTHONPATH, rather you add the parent directory of the package/module. In your case that might be `/usr/local/opt/` but can you tell us the contents of the wxpython directory? Maybe that is just source code, or just the object files (you need the binaries/objects on the PATH, but the .py files parent dir on the PYTHONPATH) – nmz787 Aug 14 '14 at 21:39

0 Answers0