Conda activate fails when running a python script
See original GitHub issueInstall miniconda Create an environment with Python 3.7 in it (on windows) Start VS code Switch to this environment Run a python file.
Expected result: File runs
Actual result:
PS D:\Training\SnakePython> conda activate jupyter
conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ conda activate jupyter
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (conda:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Running python script from wscript fails to activate conda
1. Run python · 2. Start python without starting a script · 3. Import directly in Anaconda Promptshell.
Read more >Efficient Way to Activate Conda in VSCode - Medium
One option to run Python is to run it in the terminal. On the top right corner, there is a button “Run Python...
Read more >Troubleshooting — conda 22.11.1.post16+ce4e810c9 ...
conda create myenv python conda activate myenv echo test. Neither the activation, nor the echo will happen. You must write this in your...
Read more >Conda activate scripts are not executed within ArcGIS
The crux of the problem is that activation scripts placed in %CONDA_PREFIX/etc/conda/activate.d by conda packages (such as pdal, proj, and so on) are...
Read more >Run stand-alone scripts—ArcGIS Pro | Documentation
Do I need to activate the conda environment to run a stand-alone script? No. You can use python.exe under c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro ...
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 Free
Top 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
It’s a discoverability problem like anything else in the extension, so there’s no magic solution here if people are going to skip the documentation. As I said, I made this an enhancement proposal to consider adding a notification, but we obviously have to balance that with the fact we have been criticized in the past for too many prompts, how to word the potential prompt, what actions the prompt should provide, etc.
Yeah I agree there’s a lot of discoverability issues to get this working well 😦
But you’re right, just assigning condaPath wouldn’t fix it. Users need to do “conda init” to configure PowerShell for conda. Or just to launch VS Code through the Anaconda Prompt.
I’m closing this quoting Don on issue https://github.com/Microsoft/vscode-python/issues/5541: