2

So I'm testing out the SPy library in Anaconda's Spyder, and have run into a strange error:

SystemExit: This program needs access to the screen. Please run with a Framework build of python, and only when you are logged in on the main display of your Mac.

This happens when I try to call the view_cube command from Spectral Python (SPy), which requires wxPython.

I have a feeling that this is related to Spyder's displaying of all the images generated by my program in its onboard console, instead of in independent windows.

How can I fix this error, and is there a way to tell Spyder to display images in their own windows? Can I run a "Framework Build" within Spyder?

EDIT: I was able to display the resulting images in separate windows by going to Preferences > IPython console > Graphics, and setting Backend to Mac OSX. However, the error when trying to run the view_cube command still persists...

1 Answer 1

1

I expect you're using the system version of python that comes installed on mac by default, which isn't a framework build.

You'll want to install a version of python from python.org which are all framework builds. I expect you'll want the latest version of python 2. You will also have to install your dependancies again against this new python install.

7
  • Awesome! I got it downloaded, but I'm new to python, and really new to working on a Mac. How do I transfer my code over to the framework build? Is there a built in IDE, or should I create a new file, put my code in it, and save it as some extension, or could I just point the Spyder IDE to this new build? Also, how would I install my dependencies? I have pip and homebrew installed, how can I tell them to install to this new build?
    – NGXII
    Commented Jul 20, 2015 at 17:19
  • 1
    @NGXII The reference to "framework build" is to do with the python install itself, and not to do with your IDE or code structure. There's no sense of transferring your code, python is an interpreted language so you just choose which version of the interpreter to use. I've never used Spyder IDE personally so I can't help with that, I would assume if it can run code there would be a way to specify which interpreter to use somewhere in the preferences (python.org ones install into (/Library/Frameworks/Python.framework/Versions/2.7 by default).
    – GP89
    Commented Jul 20, 2015 at 17:59
  • 1
    Regarding pip, each python install contains it's own pip. So depending on what you hit first in your $PATH. You can do pip -V to see what install the pip you're running belongs to.
    – GP89
    Commented Jul 20, 2015 at 18:02
  • 1
    The best way to manage dependancies I find is to get in the habit of using virtualenv which creates isolated python environments and a pip for each coding project
    – GP89
    Commented Jul 20, 2015 at 18:05
  • Alright, I've got Spyder pointed at the new framework build, but now how do I get pip to install the packages to it? I've been playing around with a bunch of different commands, though I'm not sure what level of /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages I should be trying to access so that pip knows what its doing
    – NGXII
    Commented Jul 20, 2015 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.