It was always a dream of mine to run python on sublime text. But a greater dream was to run Anaconda on sublime text. Here is how you do it on windows!
First Step: Undertand Sublime Text Build
Sublime text provides build options by default. It's pretty intelligent in the sense that if you install python, it'll try to get the path to the executable.
To inspect how python configures build systems, let us try building a new one
A new file opens up with some configs
But let us try saving it so see how and where it saves it
Now let us open an original build file
we see that it requires the path to an executable
Second Step: Finding the Anaconda executable
we must find the anaconda executable but not any python.exe . to find that we go to the anaconda command prompt
and we type the following
next we go to the folder and find the name of the python executable
then we build a new package and configure it then save it
next time we choose in our menu
then control + b to run
next we feel the power flowing in our veins ++++++__++
NOTE: This post gets A LOT of traffic. The author would appreciate some hearts if you are at it!
Top comments (5)
Thanks for your sharing. My problem is that Anaconda3 is installed as defaulated Just Me, not All Users(in Program\Data) as you mentioned. I know that its dirname of C:\Users\Administrator while adding my path to the environment of Win 10. I can get the path of Anaconda3 by the command 'where conda'. However, I could not use the the following command to get the dirname. Can you figure out how to solve the problem as follows.
import os
os.path.dirname(Anaconda3, file)
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Administrator\Anaconda3\lib\ntpath.py", line 221, in dirname
return split(p)[0]
File "C:\Users\Administrator\Anaconda3\lib\ntpath.py", line 183, in split
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
or
import Anaconda 3, os
path = os.path.dirname(Anaconda3.file)
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Administrator\Anaconda3\lib\ntpath.py", line 221, in dirname
return split(p)[0]
File "C:\Users\Administrator\Anaconda3\lib\ntpath.py", line 183, in split
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Thanks for your help in advance.
Mike
Sorry, the 'file'included in the parentheses in the first comment should include leading double underscore and rear double underscore. But the dialog box of the dev.to system cut the underscore lines automatically in the first comment.So I have to give you the second comment for reference.
Thanks,
Mike
Try brutely searching for all python.exe and try the one in anaconda folders
Hi, I just wanted to thank you for this guide. I rarely go out of my way to create an account to express my gratitude but this was very helpful. Thanks.
No problem. It very very nice to hear as rarely do article authors get feedback
^^