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

fail to load conda env #11012

Closed
swatakit opened this issue Apr 7, 2020 · 13 comments
Closed

fail to load conda env #11012

swatakit opened this issue Apr 7, 2020 · 13 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@swatakit
Copy link

swatakit commented Apr 7, 2020

Issue Type: Bug

I tried with a freshly installed Anaconda/vscode, create an env via conda command.
the 'python select intepreter' just does not show any envs, not even base.

Copy and paste a full path of "C:\ProgramData]Anaconda3\envs\myenv\python.exe."does not work either. It won't recognize the path. The only workaround is to manually edit settings.json

Extension version: 2020.3.71659
VS Code version: Code 1.43.2 (0ba0ca52957102ca3527cf479571617f0de6ed50, 2020-03-24T07:38:38.248Z)
OS version: Windows_NT x64 6.1.7601

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz (4 x 2808)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 19.66GB (11.81GB free)
Process Argv
Screen Reader no
VM 0%
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Apr 7, 2020
@karthiknadig
Copy link
Member

@swatakit for conda, we suggest you to activate it from the anaconda prompt first and then open your project using code . .

@swatakit
Copy link
Author

swatakit commented Apr 8, 2020

@swatakit for conda, we suggest you to activate it from the anaconda prompt first and then open your project using code . .

thanks @karthiknadig .

I tried..
pic_activate

it still, wouldn't recognize..
pic_1

it's just that, it used to work just fine, like this
https://stackoverflow.com/questions/43351596/activating-anaconda-environment-in-vscode

/wo having to manually activate at cmd, before doing 'code .'

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Apr 8, 2020
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Apr 8, 2020
@ericsnowcurrently
Copy link
Member

@swatakit, please provide the contents of the settings.json and the Python output panel. Thanks!

@ericsnowcurrently ericsnowcurrently added the info-needed Issue requires more information from poster label Apr 8, 2020
@swatakit
Copy link
Author

swatakit commented Apr 8, 2020

@swatakit, please provide the contents of the settings.json and the Python output panel. Thanks!

Hi @ericsnowcurrently ,

attached here.
json_1

This is all I have in there, as it was newly installed.

@ericsnowcurrently
Copy link
Member

Thanks, @swatakit. You're almost there. Over on the right click on the pulldown menu that says "Tools". In that menu pick "Python".

@swatakit
Copy link
Author

swatakit commented Apr 9, 2020

Thanks, @swatakit. You're almost there. Over on the right click on the pulldown menu that says "Tools". In that menu pick "Python".

Hi @ericsnowcurrently ,
Here it is..
json_2

and from 'Output' terminal
output.txt

User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - control'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'Reload - control'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'WebHostNotebook - control'
User belongs to experiment group 'LocalZMQKernel - control'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
> conda --version
> pyenv root
> python3.7 -c "import sys;print(sys.executable)"
> python3.6 -c "import sys;print(sys.executable)"
> python3 -c "import sys;print(sys.executable)"
> python2 -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> py -3.7 -c "import sys;print(sys.executable)"
> py -3.6 -c "import sys;print(sys.executable)"
> py -3 -c "import sys;print(sys.executable)"
> py -2 -c "import sys;print(sys.executable)"
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.executable)"
> conda info --json
> conda info --json
> conda env list
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -m pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text "c:\Users\[**USERNAME**]\Desktop\DASH Deployment\index.py"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -m pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text "c:\Users\[**USERNAME**]\Desktop\DASH Deployment\index.py"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import pylint"
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import pylint"
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import pylint"
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import pylint"

Linter 'pylint' is not installed. Please install it or select another linter".
Error: Module 'pylint' not installed.
> conda env list
Starting Jedi Python language engine.
Diagnostic Code: NoPythonInterpretersDiagnostic, Message: Python is not installed. Please download and install Python before using the extension.
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.prefix)"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.prefix)"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.executable)"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.executable)"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -m site --user-site
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -m site --user-site
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe completion.py
cwd: c:\Users\[**USERNAME**]\.vscode\extensions\ms-python.python-2020.3.71659\pythonFiles
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe completion.py
cwd: c:\Users\[**USERNAME**]\.vscode\extensions\ms-python.python-2020.3.71659\pythonFiles

@ericsnowcurrently
Copy link
Member

That helps, thanks! From the log it appears to use the proper Python executable. However, it may be trying to use it before certain other operations have completed, causing it to get confused.

I have some questions:

  • do you have the same problem after putting "python.disableInstallationCheck": true in your settings.json?
  • what do you see when you run C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.prefix)" manually in a terminal?

@swatakit
Copy link
Author

swatakit commented Apr 10, 2020

That helps, thanks! From the log it appears to use the proper Python executable. However, it may be trying to use it before certain other operations have completed, causing it to get confused.

I have some questions:

  • do you have the same problem after putting "python.disableInstallationCheck": true in your settings.json?
  • what do you see when you run C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.prefix)" manually in a terminal?

Hi @ericsnowcurrently ,

  • do you have the same problem after putting "python.disableInstallationCheck": true in your settings.json?
  • Still, the same though. Here is the logs from output
    output.txt
  • what do you see when you run C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.prefix)" manually in a terminal?
  • It looks ok on the terminal. No errors.
    json_4
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - control'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'Reload - control'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'WebHostNotebook - control'
User belongs to experiment group 'LocalZMQKernel - control'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
> conda --version
> pyenv root
> python3.7 -c "import sys;print(sys.executable)"
> python3.6 -c "import sys;print(sys.executable)"
> python3 -c "import sys;print(sys.executable)"
> python2 -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> py -3.7 -c "import sys;print(sys.executable)"
> py -3.6 -c "import sys;print(sys.executable)"
> py -3 -c "import sys;print(sys.executable)"
> py -2 -c "import sys;print(sys.executable)"
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.executable)"
> conda info --json
> conda info --json
> conda env list
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -m pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text "c:\Users\[**USERNAME**]\Desktop\DASH Deployment\index.py"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -m pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text "c:\Users\[**USERNAME**]\Desktop\DASH Deployment\index.py"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import pylint"
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import pylint"
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import pylint"
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import pylint"

Linter 'pylint' is not installed. Please install it or select another linter".
Error: Module 'pylint' not installed.
> conda env list
Starting Jedi Python language engine.
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.prefix)"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.prefix)"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.executable)"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "import sys;print(sys.executable)"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -m site --user-site
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe -m site --user-site
cwd: c:\Users\[**USERNAME**]\Desktop\DASH Deployment
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe completion.py
cwd: c:\Users\[**USERNAME**]\.vscode\extensions\ms-python.python-2020.3.71659\pythonFiles
> C:\ProgramData\Anaconda3\envs\dash-3.7\python.exe completion.py
cwd: c:\Users\[**USERNAME**]\.vscode\extensions\ms-python.python-2020.3.71659\pythonFiles

@ericsnowcurrently
Copy link
Member

Possibly related: #10850.

@ericsnowcurrently ericsnowcurrently removed the info-needed Issue requires more information from poster label Apr 13, 2020
@swatakit
Copy link
Author

Possibly related: #10850.

Hi , I think so yes, I have that error popups too.
Thank you for looking into this.

Best Regards,
Swatakit

@ericsnowcurrently
Copy link
Member

@swatakit, this should be resolved with the latest release of the extension (published this morning). Please verify after updating the extension.

@ericsnowcurrently ericsnowcurrently added the info-needed Issue requires more information from poster label May 12, 2020
@swatakit
Copy link
Author

swatakit commented Jun 8, 2020

@swatakit, this should be resolved with the latest release of the extension (published this morning). Please verify after updating the extension.

@ericsnowcurrently Hi, sorry for late response - I just tried, uninstall the plugin and re-installed. Still have the problem. Let me know if you need to print out any log or something

@ericsnowcurrently ericsnowcurrently removed the info-needed Issue requires more information from poster label Jun 8, 2020
@swatakit
Copy link
Author

@ericsnowcurrently hey Eric, I just wanted to give you an update, and perhaps, close this topic. I just re-format my pc and installed win10/64 bits - install the latest vscode 1.48 and Python extension. Everything works fine now. Thanks!

@ghost ghost removed the triage label Aug 20, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2021
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

3 participants