Skip to content
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

Configure Anaconda for conda virtualenv #844

Open
Elbarto opened this issue Dec 6, 2019 · 2 comments
Open

Configure Anaconda for conda virtualenv #844

Elbarto opened this issue Dec 6, 2019 · 2 comments

Comments

@Elbarto
Copy link

Elbarto commented Dec 6, 2019

Hi,

I know this isn't the correct place to post this as it is not an issue about the widget but I can't figure out how to configure Anaconda in sublime text 3 for my setup, and I don't know where to ask.

I've installed Anaconda3 (Not the the sublime text package but the python interpreter), in which I used conda to create virtualenv. On ST3 (sublime text 3), I installed the Conda package as well as the Anaconda package. With the conda package I'm able to activate conda virtualenv of my Anaconda3 install, and to execute python code on this env from ST3. But I can't figure out how to configure the Anaconda ST3 Package to be linked with my python interpreter of the Conda virtualenv and therefore get auto-complement for python lib installed in this env. I know it has to do with the "python_interpreter" path setting, but when I put the absolute path to a python.exe inside the Anaconda3/env/ dir, I've the following error :

"Anaconda can not spawn a new process with our current configured python interpreter.."

I know I'm not putting enough information for debugging an issue, I just want to know if the procedure i'm following seems correct, or if what I'm trying to do is just not possible.

Thanks a lot for your help.

@RabbitRoom
Copy link

When you open sublime, Anaconda will throw this error, and will not read data from statements.
If you run a test of currient file, the interpreter picks up the data and everything starts to work.

@Flowhill
Copy link

Flowhill commented Oct 6, 2020

I have spend all day getting the autocomplete function of Anaconda (the ST3 plugin) to work together with a conda environment (from the Anaconda Python interpreter) and the solution in this issue did the trick: #736

Try with this python_interpreter path:
"C:\\\\Users\\cschweiger\\Projects\\envs\\test\\python.exe"

Use that path also for the shell_cmd in the build configuration

This is specifically for Windows as the Windows paths denoted by \ can mess things up.
If you want to do this for a specific project make sure it has the following:
"conda_environment": "C:\Users\\Anaconda3\envs\<YOUR_ENV>",
"settings":
{
"python_interpreter": "C:\\Users\\Anaconda3\envs\<YOUR_ENV>\python.exe"
}

If you keep the "build_systems:" part that Anaconda (ST3 plugin) creates it will automatically reset it's "shell_cmd":
but it you remove it and run your code (CTRL+B) after having activated the correct environment with the Conda plugin it will automatically create the following in your project file.
"build_systems":
[
{
"file_regex": "^[ ]File "(...?)", line ([0-9]*)",
"name": "Anaconda Python Builder",
"selector": "source.python",
"shell_cmd": ""c:\Users\\Anaconda3\envs\<YOUR_ENV>\python.exe" -u "$file""
}
]
This should get the auto-completion to work.

I think this ABSOLUTELY has to be added to the configuration page!
@DamnWidget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants