Sublime Forum

Installing matplotlib Problem


I am a new Sublime Text and Python user. To date I have not been able to get matplotlib to install in Sublime Text. One of you thoughtfully suggested that I use Package Control; however, it appears that the curated list of packages does not include matplotlib.

Is there some way to get Package Control to implement packages not in its curated list? Is there a work around?

Is there another way to get matplotlib installed in Sublime Text? If so, I would very much appreciate your showing me the needed steps.




Are you trying to install it for use with a Sublime Text plugin or for use with whatever you’re writing.



Thanks for the interest and question. What I want to do is be able to write programs in Sublime Text and be able to use matplotlib to generate graphs, etc. of data



Package Control is for Sublime Text plugins, not for programs you write using Sublime Text. You’ll need to use PIP or your distribution’s package manager to install matplotlib for your system python installation.



You could try Anaconda (the app, not the ST plugin).



Sublime Text is a text editor. Matplotlib is a 3rd party python package. You can’t install it in ST. That doesn’t have any meaning.

As I mentioned above, you can’t install Matplotlib using PC. PC is like a marketplace for ST packages, not Python packages.

I have no issues in using ST with writing python code and using matplotlib as a dependency. Just make a virtual environment, activate it, install Matplotlib in that and use the command line. Note that you can’t use the default build system since that targets the global installed interpreter (& not the virtual environment one). If you install Matplotlib globally, then I believe you can use the default build system. But I’d encourage, the use of virtual environments.



At the top of the attachment is the program using that I tried to run. This program runs perfectly when input using the terminal. However when I run it in Sublime Text using the Build command I get the result shown. Curiously, the 4 Name values at the top of the listing appear from “nowhere” - probably associated with some prior programs I have run using Sublime Text. After the 4 Names is a long list of information that as a rookie user I do not understand.

Can you help me understand what to do next. Does this mean I should learn how to make a virtual environment and try again there?



What happens when you run the exact same command on the command line? ie. /use/local/bin/python3 -u '/Users/paulbrizzolara/Documents/python_work/mat test'



Can you check if this is the case ?