Sublime Forum

Import Pylab Error

#1

Hello,

Can someone please help me with creating graphs within the Sublime Text environment? I have anaconda installed and have been able to run various simple math scripts successfully. Here is what my example code looks like:

x_numbers = [1, 2, 3]
y_numbers = [2, 4, 6]
from pylab import plot, show
plot(x_numbers, y_numbers)
show()

This works when running in the anaconda idle shell, but when I try to run it in Sublime, I get the error “No module named ‘pylab’”. Any help would be greatly appreciated!

0 Likes

#2

Sublime Text comes with its own python 3.3 interpreter. You can’t simply import libraries installed by pip.

What you need to do to use a library is to either

  1. create a dependency package for it (for public use)
  2. or just put the desired libraries into Data/Lib/python3.3/ directory, where the location of Data depends on your setup.
0 Likes