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

"Run Python File in Terminal" produces "Could not find conda environment" #7707

Closed
stmax82 opened this issue Oct 1, 2019 · 1 comment
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@stmax82
Copy link

stmax82 commented Oct 1, 2019

Environment data

  • VS Code version: 1.38.1
  • Extension version: 2019.9.34911
  • OS and version: Win 10
  • Python version & distribution: Python 3.6, Miniconda
  • Type of virtual environment used: conda

Actual behaviour

I have a few python files in c:\temp\foo and I create a local conda environment in c:\temp\foo\myenv with

C:\temp\foo>conda create -p myenv python=3.6

Note that this environment is stored in c:\temp\foo\myenv, not globally.

I can successfully select this environment in VS Code (lower left corner) - it says "Python 3.6.9 64-bit ('myenv': conda)".. fine.

But when I open a python file and select "Python: Run Python File in Terminal" a terminal opens and prints the following error when activating the environment:

C:\temp\foo>activate myenv
Could not find conda environment: myenv
You can list all discoverable environments with `conda info --envs`.


C:\temp\foo>C:/temp/foo/myenv/python.exe c:/temp/foo/test.py
hey

C:\temp\foo>

Expected behaviour

Instead of activate myenv the right thing to run would be activate .\myenv or activate c:\temp\foo\myenv.

@stmax82 stmax82 added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Oct 1, 2019
@karrtikr karrtikr added the triage label Oct 1, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Oct 1, 2019
@karrtikr
Copy link

karrtikr commented Oct 1, 2019

We are moving to using conda run which runs an executable from within a conda environment without activating it. It won't need activate, so this would be fixing all these issues. Closing this in favor of #7425

@karrtikr karrtikr closed this as completed Oct 1, 2019
@ghost ghost removed the triage label Oct 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants