Issue
My Matplotlib was installed as part of the Spyder DMG package. Now, I am trying to write Python code with Sublime Text 2. But my code, which uses the figure()
method and from pylab import *
statement, cannot load Matplotlib. The error message is:
Traceback (most recent call last):
File "/Users/xx/Desktop/test.py", line 3, in <module>
from pylab import *
ImportError: No module named pylab
[Finished in 1.3s with exit code 1]
Solution
(Spyder dev here) I haven't used Sublime but it seems you have to do these things:
Install SublimeREPL
Configure it to use the Python interpreter that comes with our DMG, which has
matplotlib
and alsoIPython
,scikit-learn
,scikit-image
,scipy
,sympy
andpandas
. It's full path can be found in:Spyder > Preferences > Console > Advanced Settings > Python Executable
Note: I also recommend you to install a Python scientific distribution, which comes with a much larger amount of scientific packages. My preferred one is Anaconda.
Answered By - Carlos Cordoba
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.