Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Newly created conda and Poetry generated venv not found #10476

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

Closed
trallard opened this issue Mar 9, 2020 · 7 comments
Closed

Newly created conda and Poetry generated venv not found #10476

trallard opened this issue Mar 9, 2020 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@trallard
Copy link

trallard commented Mar 9, 2020

Environment data

  • VS Code version: 1.42
  • Extension version (available under the Extensions sidebar): 2020.2.64397
  • OS and version: macOS Mojave 10.14.6
  • Python version (& distribution if applicable, e.g. Anaconda): anaconda / Python 3.7.5
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda and poetry virtualenv
  • Relevant/affected Python-related VS Code extensions and their versions: Python 3.7
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977): Jedi enabled
  • Value of the python.languageServer setting: Microsoft

Expected behaviour

After creating a new virtual environment through Conda or Poetry I should be able to select this as the Python interpreter for the project. So VSCode should be able to find it automatically and provide it as an option:

collect_data_py_—_undiasinnnosotras

Actual behaviour

I have been having problems selecting the Python interpreter whenever I create a new environment either using Conda or Poetry. The environment is not available to choose as an interpreter (see image above).
Sometimes this appears after restarting VSCode but not every time despite me having set my settings accordingly.

settings_json_—_undiasinnnosotras
I have even set the python.pythonPath to point manually to the venv created.

For reference:

python

Also other folks have been finding this rather frustrating: https://twitter.com/story645/status/1220450768383332353

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Create new env using poetry install
  2. In VSCode > Select Python interpreter
  3. Reload Window in VS Code

I have not managed to get my Poetry venvs working at all

@trallard trallard added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Mar 9, 2020
@karthiknadig
Copy link
Member

Notes for anyone looking into this issue, poetry env are not yet supported #8372. We need to investigate the conda env discovery.

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Mar 9, 2020
@DonJayamanne
Copy link

need to investigate the conda env discovery.

Dup of existing issue, can't remember number. Basically you need to reload VSCode to refresh the list of interprets. There's an issue for that, created by @ericsnowcurrently

@karthiknadig
Copy link
Member

I suspect we may have missed adding ~/.conda/environments.txt to file system watcher. If we do add that then we should remove the task to eliminate CondaFileEnvService. There are two reasons now to preserve it (the other reason being: On mac we sometimes cant find path to conda binary and realy on environments.txt). Until we get the regular env detection to work correctly.

@kimadeline
Copy link

kimadeline commented Mar 9, 2020

@DonJayamanne this: #2640 ?

@karthiknadig do you remember the issue tracking the CondaFileEnvService task?

@DonJayamanne
Copy link

suspect we may have missed adding ~/.conda/environments.txt to file system watcher.

Vsc doesn't support watching files outside the workspace.
Also doing this ourselves is not advisable, as there are tonnes of issues (cross play, CPU, etc), after all vsc doesn't support it for a reason.

@DonJayamanne
Copy link

DonJayamanne commented Mar 9, 2020

DonJayamanne this: #2640 ?

Yes.

On mac we sometimes cant find path to conda binary and realy on environments.txt). Until we get the regular env detection to work correctly.

Yes, that's correct.
Fun times with conda and finding stuff..

@kimadeline
Copy link

Closing it as duplicate of #2640 and #8372.

@ghost ghost removed the triage label Mar 9, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 17, 2020
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

4 participants