I am uinsg sublime 2 on a windows machine and not figure out how can I manage and add different python packages into the sublime 2 python? I have multiple versions of python on my machine and it seems sublime is using my python 2.7 ( i dont remember if I set that). I also have REPL up and running but I can not make the python 2.7 from the command line of my sublime to import numpy or install or anything. if you can explain to me how can I work around issues like this it would be great.
2 Answers
To install packages such as pyGame, you need to download the installer and run it. Since you have multiple versions of Python, you will need to select the required version in the installer.
A link to pyGame: http://www.pygame.org/download.shtml
Link to all packages: https://pypi.python.org/pypi?%3Aaction=index
Make sure to download the packages for your required python version. You could also use easy install which would simplify the module installation process.
EDIT:
To link sublime text and python:
1) Create a new build system by: Tools > Build System > New build system
2) Add the following lines to it:
{
"cmd": ["C:\\Python27\\python.exe", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
(Change the path if required)
3) Save the file and build (Ctrl + B) your programs to run with your python.

- 658
- 6
- 24
-
I am not sure how to do this through Sublime? since I would have love to stay working in it. – Amir Nov 30 '14 at 21:14
-
I dont think you can install modules using sublime. As I said earlier, install the module using the package installer and select your python. After that, you can continue using sublime. Have you linked sublime to your python? – adb16x Dec 01 '14 at 01:11
-
I am not exactly sure how sublime is connected to that python. before your comment I thought sublime has a python in it itself. but now I feel that it is actually connected to one of my pythons and all I need is to install those packages on that python seperatly(outside of Sublime) and then use the python with new packages in sublime. I'll work on it, thanks. – Amir Dec 01 '14 at 04:58
- install cmder from https://cmder.net/
- run cmder
- type this code
pip install XXXX
just replace your package name with "XXXX".
for example: pip install numpy
you can install other packages with this way:))

- 1