nwhitehead / pineapple

http://nwhitehead.github.io/pineapple/
Other
352 stars 26 forks source link

Can't find PySide when opening from terminal #36

Closed rtunnard closed 9 years ago

rtunnard commented 9 years ago

Found a rather strange error: I don't know enough to submit a fix myself.

When opening Pineapple-Pro from the app list in the GUI, it works perfectly (lovely program btw!).

However, when opening from the terminal with:

open /Applications/Pineapple-Pro.app

it loads, but then when I try to import matplotlib.pyplot there is an import error, whose traceback culminates with:

/Users/rtunnard/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/backends/qt_compat.pyc in () 124 125 else: # try importing pyside --> 126 from PySide import QtCore, QtGui, version, version_info 127 if version_info < (1, 0, 3): 128 raise ImportError(

ImportError: No module named PySide

Even more strangely, I can import matplotlib by itself, and then matplotlib.pyplot.plot(range(10)) claims that matplotlib has no pyplot attribute!

Not sure if this is a problem caused by my Python setup or a program bug.

Mac OSX 10.10.5 with Enthought Canopy 1.5.0 (Python 2.7.6 64bit).

nwhitehead commented 9 years ago

This is almost surely a problem with environment variables and configuration. With the latest changes for the upcoming release, this should not be a problem any more. Right now variables such as PYTHONPATH and PYTHONSTARTUP are being inherited by Pineapple and passed to the internal version of python inside the app, which is using the wrong versions of things. In the upcoming release all the environmental variables should be ignored, so you'll always get the internal python in a sane state when starting Pineapple.

The workaround right now is to do "unset PYTHONPATH", "unset PYTHONSTARTUP", etc. before you do your "open Pineapple...".

If you still see this issue in the next release go ahead and reopen the bug.