Conda activate is failing when conda is in '/usr/bin/' folder
See original GitHub issueEnvironment data
- VS Code version: 1.43.2
- Extension version (available under the Extensions sidebar): 2020.3.71113
- OS and version: Fedora 31
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.7
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
- Relevant/affected Python packages and their versions: n/a
Workspace Settings
{
"python.pythonPath": "/home/julian/.conda/envs/pdi-practica2020/bin/python"
}
Actual behavior
Starting a Jupyter Notebook server fails with error:
Activating Python 3.7.7 64-bit ('pdi-practica2020': conda) to run Jupyter failed with Error: Command failed: . /usr/bin/activate pdi-practica2020 && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /home/julian/.vscode/extensions/ms-python.python-2020.3.71113/pythonFiles/printEnvVariables.py bash: /usr/bin/activate: No such file or directory .
Expected behavior
The extension should use plain conda activate
to activate the conda environment, as the extension does (I think?) when opening a terminal.
Steps to reproduce:
- Install conda using the package manager:
sudo dnf install conda
- Create an environment that includes Jupyter:
conda create --name vscode-test notebook
- Open a folder with VSCode.
- Use the “Select Interpreter” command to activate the vscode-test environment.
- Use the “Create New Blank Jupyter Notebook” command.
- Add code to the first cell (for example
import sys
) and run it.
Notes
May be related to #2315 and #7671 and the way they were solved.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:20 (1 by maintainers)
Top Results From Across the Web
anaconda - Conda activate not working? - Stack Overflow
My PATH environment variable was set properly so conda activate base did not raise any error but quietly failed.
Read more >Troubleshooting — conda 22.11.1.post16+ce4e810c9 ...
The hash is reset by conda activate or by hash -r in bash or rehash in zsh. Programs fail due to invoking conda...
Read more >Trouble installing conda on archlinux - Google Groups
Operation failed. Running $ source activate koopdi, activates the environment - koopdi - I created. How can I migrate my conda to my...
Read more >Force R to read folders outside of conda environment to install ...
Stack Overflow for Teams – Start collaborating and sharing organizational knowledge. Create a free Team Why Teams?
Read more >Unable to run `conda activate` from Jenkins pipeline
What we do is download and install miniconda in the first step in our (declarative) pipeline and create the environment(s) from a yaml...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi recently I also encounter_ similar problem, then I find that in the latest python-extension(v2021.1.502429) comes with setting that you can manually specify the root of the conda path:
After assigning the conda path I can launch the jupyter-notebook normally
I’m having a similar issue.
I am using VS code on WSL and have installed Miniconda. I have created an environment inside a project directory, and VS Code correctly locates that environment which I can select from the interpreters list.
When I go to open an integrated terminal however, I get:
For some reason
source
is being called in place ofconda
.