Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with scientific_startup in other interpreters from the one Spyder is running on #1322

Closed
spyder-bot opened this issue Feb 17, 2015 · 17 comments

Comments

@spyder-bot
Copy link
Collaborator

From breed...@gmail.com on 2013-03-17T13:12:23Z

Spyder Version: 2.2.0beta4
Python Version: 2.7.3
Qt Version: 4.8.2, PyQt4 (API v2) 4.9.4 on Darwin

What steps will reproduce the problem?

  1. Create a virtual environment called basic, using the default, Apple distributed, python interpreter
    1. In Preferences->Console->Advanced Settings->Path to Python interpreter execurable binary: /Users/Ben/.virtualenvs/basic/bin/python/
    2. Tools->Update Module List
    3. Restart Spyder What is the expected output? What do you see instead? The expected output are no errors in the console. What I get is:

Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/spyderlib/scientific_startup.py", line 16, in
from pylab import * #analysis:ignore
ImportError: No module named pylab

Please provide any additional information below

.

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1322

@spyder-bot
Copy link
Collaborator Author

From breed...@gmail.com on 2013-03-18T15:14:18Z

Update 1: In case it matters I used --system-site-packages when I created my virtual environment.

Update 2: I also run into problems when using EPD64 and virtualenv. Using the system level version of EPD64, things work fine. However, when I create a virtual environment using the EPD64 interpreter, I get the following errors from Spyder's console:

Python 2.7.3 |CUSTOM| (default, Apr 12 2012, 11:14:05)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/spyderlib/scientific_startup.py", line 16, in
from pylab import * #analysis:ignore
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/pylab.py", line 1, in
from matplotlib.pylab import *
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/pylab.py", line 264, in
from matplotlib.pyplot import *
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/pyplot.py", line 95, in
new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/backends/init.py", line 25, in pylab_setup
globals(),locals(),[backend_name])
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", line 12, in
from backend_qt4 import QtCore, QtGui, FigureManagerQT, FigureCanvasQT,
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/backends/backend_qt4.py", line 23, in
from qt4_compat import QtCore, QtGui, _getSaveFileName, version
File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/backends/qt4_compat.py", line 36, in
import sip
ImportError: No module named sip

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-03-19T15:36:53Z

breedlun: I can fix your second problem (i.e. the one with EPD) but for the first one I would like to ask you:

Do you have matplotlib installed in your Apple distributed Python? If not, you have to deactivate the scietific_startup script

@-Pierre: Should we enclose every import statement of scientific_startup in a try/except statement? As this issue shows, it's disturbing to find those ImportError's after changing interpreters.

Cc: pierre.raybaut
Labels: OpSys-OSX MS-v2.2

@spyder-bot
Copy link
Collaborator Author

From brookinc...@gmail.com on 2013-03-19T17:56:39Z

Great. I am glad to hear you can fix the problem with EPD64.

I was using the virtualenv with the EPD64 interpreter for a while and found it worked fine for most tasks in spite of the string of errors listed above. However, I believe I got an error when I tried to use matplotlib. At that point, I just switched back to the interpreter that is bundled with Spyder. Hopefully, if you get rid of the errors above, I will be able to use virtualenv, EPD64, and matplotlib simultaneously.

To answer your question, the Apple distributed python that comes bundled with OS X 10.8 (Mountain Lion) does not appear to have matplotlib installed. I probably should have realized that was the problem. I guess I should install matplotlib in my virtual environment.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-03-25T09:42:37Z

Summary: Mac app - Problems with scientific_startup in a virtualenv (was: Virtualenv and scientific_startup.py)

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-04-06T20:31:27Z

Labels: Cat-Console

@spyder-bot
Copy link
Collaborator Author

From jed.lud...@gmail.com on 2013-04-29T15:08:37Z

Labels: MS-v2.2.1

@spyder-bot
Copy link
Collaborator Author

From jed.lud...@gmail.com on 2013-04-29T15:10:06Z

Labels: -MS-v2.2

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-06-28T05:46:33Z

Labels: -MS-v2.2.1 MS-v2.3
Blockedon: spyderlib:1365

@spyder-bot
Copy link
Collaborator Author

From breed...@gmail.com on 2013-07-24T10:06:12Z

Now that enthought has switched from EPD to Canopy, I am not sure this issue is very relevant anymore.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-08-09T20:08:54Z

The problem still exists for any external interpreter on Mac (not just EPD/Canopy) and I need to address it.

@spyder-bot
Copy link
Collaborator Author

From breed...@gmail.com on 2013-08-09T21:25:46Z

Ahh. Ok. Then thank you in advance for addressing it. As it stands now, Spyder is far superior to Canopy's bare bones GUI, so I would really like to use Spyder (with the scientific start-up script) in conjunction with Canopy's python distribution.

@spyder-bot
Copy link
Collaborator Author

From breed...@gmail.com on 2013-09-22T10:25:13Z

I just tried building Spyder from source (python setup.py install) inside a canopy venv. I then ran spyder, went into preferences, turned off the scientific_startup script, and restarted spyder. (I would really like to use the scientific start-up script, but I thought I would see what happens without it.) I get the text below in the console when I try to import numpy. When I run the canopy venv from the command line, I can import numpy just fine. Should this work in spyder, or is this hopeless?

Enthought Canopy Python 2.7.3 | 64-bit | (default, Aug 8 2013, 05:37:06)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import numpy
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named numpy

@spyder-bot
Copy link
Collaborator Author

From breed...@gmail.com on 2013-09-23T20:20:36Z

Update: I tried the same thing with pip and things worked better, but not perfectly. I could import numpy and sys, but I ran into trouble with matplotlib.pyplot. As you can see below, it complains that there is no module named PySide.

Enthought Canopy Python 2.7.3 | 64-bit | (default, Aug 8 2013, 05:37:06)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import matplotlib.pyplot
Traceback (most recent call last):
File "", line 1, in
File "/Users/Ben/Library/Enthought/Canopy_64bit/Test_User/lib/python2.7/site-packages/matplotlib/pyplot.py", line 98, in
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/Users/Ben/Library/Enthought/Canopy_64bit/Test_User/lib/python2.7/site-packages/matplotlib/backends/init.py", line 25, in pylab_setup
globals(),locals(),[backend_name])
File "/Users/Ben/Library/Enthought/Canopy_64bit/Test_User/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", line 13, in
from backend_qt4 import QtCore, QtGui, FigureManagerQT, FigureCanvasQT,
File "/Users/Ben/Library/Enthought/Canopy_64bit/Test_User/lib/python2.7/site-packages/matplotlib/backends/backend_qt4.py", line 25, in
from qt4_compat import QtCore, QtGui, _getSaveFileName, version
File "/Users/Ben/Library/Enthought/Canopy_64bit/Test_User/lib/python2.7/site-packages/matplotlib/backends/qt4_compat.py", line 90, in
from PySide import QtCore, QtGui, version, version_info
ImportError: No module named PySide

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-10-02T15:17:18Z

Labels: -MS-v2.3 MS-v2.2.5

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-10-02T15:20:21Z

Summary: Problems with scientific_startup in other interpreters from the one Spyder is running on (was: Mac app - Problems with scientific_startup in a virtualenv)
Labels: -OpSys-OSX

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-10-03T07:41:10Z

Blockedon: -spyderlib:1365

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-10-03T07:43:18Z

This issue was updated by revision 0be53f30eec3 .

  • Now (I hope) scientific_startup will never throw an error again.

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant