Sublime Text2 error: no module named Gnuplot

I am trying to use Gnuplot in a Python script. I am writing in Sublime Text. Whenever I build, I get an error

Traceback (most recent call last): File "..." line 4, in <module> import Gnuplot ImportError: No module named Gnuplot 

If I make exact lines of code directly in the terminal, I have no problem importing and using Gnuplot.

The import error seems to be common, only with other modules. Typically, the fix is ​​related to PYTHONPATH. However, Gnuplot is located on my computer located in

 /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages 

and therefore should be found.

Anyone who got a fix for this?

+6
source share
1 answer

Sublime Text 2 comes with its own Python interpreter, which sets PYTHONPATH regardless of the Python system interpreter you are referencing.

Please see this question on how to install another PYTHONPATH for Sublime. Note that if the library you use was compiled against a different version of Python than Sublime uses to load native dynamically linked libraries, it will likely crash Sublime Text 2.

fooobar.com/questions/116602 / ...

+5
source

All Articles