-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Unable to access Python 3 environments in /anaconda2 #7548
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
Comments
@juliussimonelli, thanks for letting us know about this. I'm going to take a look at this as soon as I can. |
The values you tried in your settings.json aren't quite right. Try using the following workspace settings: {
"python.pythonPath": "/anaconda2/envs/python3/bin/python",
"python.condaPath": "/anaconda2/bin/conda"
} |
I just updated it to your suggestion and it's still not working. Same error. |
Also, is the "python3" environment one using Python 3? If so then that's probably your problem. It looks like you're using Anaconda set up for Python 2. In particular, the |
Yes, it is using Python 3. The actual conda environment works fine though. I can activate it and run Python 3 code on it with no problem. |
It has its own
|
When Python resolves imports, the first match under It sounds like that isn't a problem for you, but it might impact how we invoke the interpreter when discovering the available interpreters. What do you see in the "Python" output panel? We should see conda being invoked in various ways when looking for interpreters. For example, here's what I see (using miniconda, with several other system Pythons installed):
I'd like to see what is showing up for you. It may also be useful to see the "developer tools" output, from Note that (currently) when we invoke the interpreter from a particular conda environment, we run the executable directly, rather than using |
Here's the output from the Python panel:
|
Thanks, that really helps. From the "Python" output panel the key point chronologically is the line that starts with Also, what happens when you invoke the problematic script directly? Try the following (copied from the logs you provided):
|
yep, it's an enum problem:
|
What do you get from the following?
|
|
Yep, looks like that
Do you know what added |
FWIW, I'm fairly sure that #7425 (using |
Yea, it looks like my .bash_profile was adding it and putting it first. I could put it last or remove it completely. I tried removing it completely with |
Try leaving |
If I unset PYTHONPATH and click on "Select Python Interpreter" I still don't see python3. If I then open a new VSCode and check my PYTHONPATH it is reset with all the previous stuff (except |
What do you get for:
|
|
Please get the logs again from the "Python" output panel and the developer console. Thanks! |
Here's the Python output panel:
|
I'm having the same problem in: Version: 1.38.1 The anaconda environment is perfectly accessible through command line but vscode, despite explicitly specifying python.pythonpath cannot find it. Here's the environment in question: jubei$ conda info active environment : mlagents |
In my case the problem was a broken anaconda installation. Different environments were in different subdirectories. I have since re-installed anaconda and the problem seems to be fixed but nevertheless, given an explicit path to the environment the python plugin should have been able to load it. |
@juliussimonelli, sorry for the long delay. Have you tried re-installing Anaconda? Also, you mentioned that you were having the problem even though What does |
Right now I get:
although the environment might have changed since I first posted this. I should probably just reinstall Anaconda and see if that helps. I think last time I installed Anaconda2 and made python 3 environments, but this time I'll install Anaconda3 and make python2 environments. |
@juliussimonelli, sounds good. Please let us know if you see any problems under Anaconda3. Thanks! |
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on then we will be happy to re-open this issue to pick up where we left off. |
Uh oh!
There was an error while loading. Please reload this page.
Issue Type: Bug
When I try to select a Python interpreter, only the Python 2 environments are appearing. I created a python 3 environment in anaconda but it is not showing up as a Python interpreter in VSCode.
When I look at my conda environments, I see:
But when I try to select an interpreter only base, sk, and other (non conda) interpreters appear. I went into my settings.json and added:
but the bottom left still says "Select Python Interpreter" and I cannot run the code. Restarting it did not help. Note that outside of VSCode I can run the python 3 environment and it works.
Here is the output of
conda info --json
Extension version: 2019.9.34911
VS Code version: Code 1.38.1 (b37e54c98e1a74ba89e03073e5a3761284e3ffb0, 2019-09-11T13:31:32.854Z)
OS version: Darwin x64 18.7.0
Remote OS version: Linux x64 3.10.0-957.5.1.el7.x86_64
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: