Hi friends,

Like several others on this forum, I am experiencing problems getting 
Enthought Canopy and Spyder to interact correctly. More specifically, I 
would like to load modules that are installed into my Canopy distribution 
when using the IPython and Python consoles inside Spyder. When I do this, I 
encounter errors. Here is my exact setup.



Operating System: OSX 10.10.1 (latest)
Enthought Canopy Version: 1.5.1.2730 (latest; 64-bit; academic version)
Spyder Version: 2.3.1 (latest; installed via dmg)
IPython version: 2.3.1-1 (latest; installed via Canopy Package Manager)



Here are the only lines relating to Canopy in my ~/.bash_profile file.

#
# Added by Canopy installer on 2013-09-01
# VIRTUAL_ENV_DISABLE_PROMPT can be set to '' to make bashprompt show that 
Canopy is active, otherwise 1
# VIRTUAL_ENV_DISABLE_PROMPT='1' source 
/Users/mike/Library/Enthought/Canopy_64bit/User/bin/activate
#
export ETS_TOOLKIT=qt4
export QT_API=pyside
export PATH=/Users/mike/Library/Enthought/Canopy_64bit/User/bin:$PATH

#
# Exporting the paths of Canopy Python libraries so that a custom-built GDB 
can load them 
#
export 
DYLD_LIBRARY_PATH=/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents:$DYLD_LIBRARY_PATH
export 
DYLD_LIBRARY_PATH=/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib:$DYLD_LIBRARY_PATH
export 
DYLD_LIBRARY_PATH=/Users/mike/Library/Enthought/Canopy_64bit/User:$DYLD_LIBRARY_PATH



Here is what I see when I type "python" from the console. *Note that I can 
import matplotlib.pylot without errors.*

*Last login: Sat Nov 29 23:22:55 on ttys001*
*Mikes-MacBook-Pro-2014:~ mike$ python*
*Enthought Canopy Python 2.7.6 | 64-bit | (default, Sep 15 2014, 17:43:19) *
*[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin*
*Type "help", "copyright", "credits" or "license" for more information.*
*>>> import matplotlib.pyplot*
*>>> *




I have configured Spyder to point to Canopy python as follows. I have set 
the "Spyder > Preferences... > Console > Advanced Settings > Python 
executable" setting to 
"/Users/mike/Library/Enthought/Canopy_64bit/User/bin/python" without the 
quotes.

I have configured Spyder to use the default PYTHONSTARTUP script as 
follows. I have set the  "Spyder > Preferences... > Console > Advanced 
Settings > PYTHONSTARTUP replacement" setting to the "Default PYTHONSTARTUP 
script" option.



Here is where I begin to see symptoms of my issue. When I attempt to 
navigate to the IPython console within Spyder, I get the following error.

*"An error ocurred while starting the kernel*
*Either:*
*Your IPython frontend and kernel versions are incompatible or*
*You don't have IPython installed in your external interpreter.*
*In any case, we're sorry but we can't create a console for you."*

When I navigate to the Console within Spyder, I see that Canopy Python has 
been loaded correctly. However, when I try to import matplotlib.pyplot I 
get the following error.

*Enthought Canopy Python 2.7.6 | 64-bit | (default, Sep 15 2014, 17:43:19) *
*[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 "<stdin>", line 1, in <module>*
*  File 
"/Users/mike/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/pyplot.py",
 
line 28, in <module>*
*    from matplotlib import style*
*  File 
"/Users/mike/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/style/__init__.py",
 
line 3, in <module>*
*    from .core import use, context, available, library, reload_library*
*  File 
"/Users/mike/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/style/core.py",
 
line 149, in <module>*
*    _base_library = load_base_library()*
*  File 
"/Users/mike/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/style/core.py",
 
line 94, in load_base_library*
*    library.update(read_style_directory(BASE_LIBRARY_PATH))*
*  File 
"/Users/mike/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/style/core.py",
 
line 126, in read_style_directory*
*    for path, name in iter_style_files(style_dir):*
*  File 
"/Users/mike/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/style/core.py",
 
line 115, in iter_style_files*
*    for path in os.listdir(style_dir):*
*OSError: [Errno 2] No such file or directory: 
'/Applications/Spyder.app/Contents/Resources/mpl-data/stylelib'*
*>>> *

I noticed that people on this forum were having similar issues with older 
versions of Spyder. Are there any workarounds to this specific issue, for 
this specific version of Spyder? Can I install an experimental version from 
source to get this working? This is a showstopper issue for me that 
prevents me from using Spyder in my work. Thank you for your help  :)

Cheers,
Mike Roberts, Stanford CS PhD student, 
http://graphics.stanford.edu/~mlrobert

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to