-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support discovering multiple conda envs with same interpreter path #18357
Comments
@rchiodo as you can see in my case there is no global python, so when i ask for python path after activation i get nothing: but if you create conda environment with python then you get python path: |
I guess I have a global python set. I didn't get that error |
Here's what I used to test: |
So if the environment itself does not have python, then we don't detect it or report anything about it. does this happen if you create it like this:
This is 3.9 because 3.10 in conda is broken. |
No that works fine. That's usually how I have to create them in order to get them to work. |
I mean this is a problem in the old API too. |
Then this is working as expected. if the environment was not created to include python we don't detect those. |
I don't think a customer is going to expect this. They have multiple conda environments but they don't see any of them. |
You can have pure R environments in conda. Do we expect python extension to detect those? The python in environment created using /cc @brettcannon, @luabud what do you suggest, should we list every conda environment or only those envs that have been setup with python. Currently we only detect those that have python in the env scripts/bin folder. |
This isn't true. If I do something like so:
It installs it here (even though python is global):
If I run python from that active environment, its sys path has been modified to use the conda location, and not the global:
Conda supports this option just fine. |
In the extension, we support both |
If we change Running this:
Put pandas in the site-packages for the environment. In fact pip seems to work by itself? I can't get it to put it in a different spot (as long as I run it from the environment). So maybe the only caveat here is that you need a global python so that those commands can run. |
@karrtikr The switch to |
The scenario where 2 environments share the same interpreter path was never supported, so this is not a bug at all. So far we haven't received users asking for this so I'm inclined to close this, unless I'm missing something? |
We have (in jupyter). That could be because people doing notebooks use conda more often. |
I just ran into this myself by accident.
Everything seems fine, except I cannot find the environment in VS Code no matter what I do. Of course if I examine my environments with conda, I see it too. This is all highly confusing.
I'm not sure I believe that this was never supported since most of the environments I've ever created I have used anaconda and I haven't specified a python version instance to install to it. In fact, the only reason I ever thought to do that was in case I wanted to use a different version of python than is available on the system. Perhaps I'm incorrect in that thinking, but it seems to make sense. Also note if I do an internet search for "How do I create a new conda environment" the first link I get is this: It basically says what I just said above. :) |
@greazer it's never been supported by us; see https://code.visualstudio.com/docs/python/environments#_where-the-extension-looks-for-environments and point 7:
conda itself may be manifesting the interpreter lazily upon |
Testing #18348
conda create -n test1
conda create -n test2
They don't show up at all.
The text was updated successfully, but these errors were encountered: