mandeep / sublime-text-conda

Work with conda environments in Sublime Text 3
BSD 3-Clause "New" or "Revised" License
26 stars 10 forks source link

Anaconda Not in Default Directory #5

Closed Zoher15 closed 6 years ago

Zoher15 commented 6 years ago

image How exactly do I need to configure the user package settings for Conda?

mandeep commented 6 years ago

On the Sublime Text toolbar go to Preferences->Package Settings->Conda->Settings - User.

Change the values in that file to the location of your install. If the user settings file is empty, copy the contents from Settings - Default into Settings - User and then change the values.

Zoher15 commented 6 years ago

Hey Mandeep, that was my initial intuition and that is exactly what I had done. But I had errors while importing packages like NLTK that were already installed. Do you have any suggestions?

mandeep commented 6 years ago

Could you show me what kind of errors you're getting? With the paths in the settings file changed, you would then need to activate the root environment or another conda environment via the Conda: Activate command.

Zoher15 commented 6 years ago

image

image

image

mandeep commented 6 years ago

Is the Conda build system selected in Tools->Build System?

Zoher15 commented 6 years ago

Yes Mandeep

Zoher15 commented 6 years ago

Is something wrong with my custom path?

mandeep commented 6 years ago

Your directory is C:\Users\zoya\Anaconda2 but the directory in settings is listed as ~/anaconda2/. I'm not familiar with how Windows handles filenames but does the plugin work if you capitalize the A in the anaconda2 path?

Zoher15 commented 6 years ago

I tried capitalizing as well as entering the entire path

Zoher15 commented 6 years ago

I even installed nltk using conda just to check. Did not work. I cant find an .condarc file for some reason

mandeep commented 6 years ago

If you write import sys in a Python file and print(sys.executable) does the correct path show? Are you able to import any other packages in your environment? According to your conda info screenshot your config file is in C:\Users\zoya\.condarc, however I don't think it matters in this case .I'm unable to replicate this which is why I'm trying to see what exactly could be causing this on your system.

Zoher15 commented 6 years ago

It goes to C:\Python27\python.exe

despite setting my user settings as // Default settings for sublime-text-conda: { // executable is the path to anaconda's python // this python executable is used in order to find conda "executable": "C:\Users\zoya\Anaconda2",

// Directory in which the conda envs are stored
// Default location is the user's home directory
"environment_directory": "C:\\Users\\zoya\\Anaconda2\\envs",

// configuration is the path to conda's configuration file
"configuration": "~/.condarc"

}

mandeep commented 6 years ago

So we've narrowed it down to the path. When you open the command palette and select Conda: Activate Environment are you able to select your environment? If so, does anything appear in the status bar after selecting the env?

Zoher15 commented 6 years ago

Yes on doing all of the steps again I fixed it to the right path and was able to activate it. It is working now!

Thank you for your patience Mandeep 👍 Really appreciate your promptness :)

best, Zoher

mandeep commented 6 years ago

Glad everything worked out! 👍