Skip to content

Extension doesn't activate conda environment #6918

Closed
@cristi-neagu

Description

@cristi-neagu

Hello,

It used to be the case that when i ran a script in debug within a conda environment, the first time it would fail with the error ImportError: DLL load failed: The specified module could not be found. Right after the debugger would end, the console would run conda activate to activate the environment, and running the script again would function correctly.

But that isn't happening any longer. A few days ago i updated conda (using the prompt), and something went wrong and Anaconda shortcuts disappeared from the Start Menu. I reinstalled conda in the exact same location, and it is working fine. Jupyter Notebook launches correctly, runs ok, no problems. But now VS Code doesn't activate the environment any longer. It does see the environments and i can select them. It does seem to use the selected environment, as it complains about pylint not being installed if i switch to an environment with no pylint.

I tried adding the conda folder to the path. This actually worked for 1 session of using VS Code, and now it doesn't work any longer, with me not changing absolutely anything. I tried initializing cmd.exe for use with conda, so now i can type conda activate in the Python debug terminal and it does activate the terminal and the script can run. But VS Code is still not doing it automatically.

Also, when i installed conda, i did select the option that makes it visible to VS Code. I forget the actual wording, but it was on the same screen as the "add to path" option.

At this point i don't even know if this is a conda issue, a VS Code issue, or a Python extension issue. Any ideas are welcome.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    info-neededIssue requires more information from poster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions