How To Use Sublime Text For Python Mac

Join GitHub today

Sublime Text for Python development — My 2016 review – When you ask for editor recommendations as a Python developer one of the top choices you’ll hear about is Sublime Text. In this post I’ll review the status of Python development with Sublime Text as of 2016.

GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Sign up New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments

Python in sublime text 3

commented Sep 24, 2013

Hi, I'm on mac and looking to use SublimeREPL with python 3.3 version there.
Right now I have 2.7.

My os version is 10.8

Thanks!

commented Sep 24, 2013

Create python3 virtualenv in one of the directories scanned by SublimeREPL, and use 'Python: virtualenv' REPL.

PS.
in your virtualenv do pip install IPython pyzmq to enable IPython goodness in SublimeREPL.

closed this Sep 26, 2013

commented Oct 13, 2013

If you don't want to use virtualenv, create Packages/User/SublimeREPL/config/Python/Main.sublime-menu with the following contents:

You'll need to modify the path to python3 if you're not using MacPorts. I'm of two minds about virtualenvs - on the one hand they're great for creating perfectly customized environments, testing different versions of modules, etc., but on the other hand I like just having one single environment with all of my packages available. The choice is up to you :)

commented Dec 10, 2015

Thanks very much for your help. Trying this on OS X El Capitan with Sublime Text 3 and Python 3.5. I presume the Path is /Library/Frameworks/Python.framework/Versions/3.5/bin. I replace the
'cmd': ['/opt/local/bin/python3', '-i', '-u'],
with
'cmd': ['//Library/Frameworks/Python.framework/Versions/3.5/bin', '-i', '-u']
then error:
PermissionError(13, 'Permission denied')
should I chmod anything? Or should I have sudo'd something I haven't?

commented Dec 13, 2015

@harri00413 you forgot to add the python3 executable on to the end of it:

commented Dec 13, 2015

Thanks, that worked. Now I only need to make a quick link or so to run the current module.

commented Mar 15, 2016

Thanks a lot, I try it, easy to use.

commented Mar 29, 2016

if you have installed python3 on your mac, just replace 'cmd': ['python', '-i', '-u'], with 'cmd': ['python3', '-i', '-u'],

commented Jan 3, 2018
edited

Sublime With Python

if you have installed python3 and SublimeREPL, you can try setting up key bindings with the correct path to the python3 file.

You can try by copying this code into your /Sublime Text 3/Preferences/Key Bindings/

Hope this helps!

How To Use Sublime Text For Python Mac

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment