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

Extensions cannot find python interpreter #22480

Closed
dcgudeman opened this issue Nov 16, 2023 · 6 comments
Closed

Extensions cannot find python interpreter #22480

dcgudeman opened this issue Nov 16, 2023 · 6 comments
Assignees
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@dcgudeman
Copy link

Type: Bug

Behaviour

Expected vs. Actual

Black Formatter working
Mypy type checker working
isort working

vs

Black Formatter: Server failed to start.
Mypy Type Checker: Please select a Python interpreter.
isort: Please select a Python interpreter.
XXX

Steps to reproduce:

  1. Create python project and install deps in .venv
  2. install Python, Black, Mypy, isort extensions
  3. open existing python project and try to format any python file

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda):
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Unknown
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings

Multiroot scenario, following user settings may not apply:

languageServer: "Pylance"

Extension version: 2023.20.0
VS Code version: Code 1.84.2 (Universal) (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:52:33.687Z)
OS version: Darwin arm64 23.1.0
Modes:

System Info
Item Value
CPUs Apple M2 Max (12 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 2, 3, 3
Memory (System) 96.00GB (29.02GB free)
Process Argv --crash-reporter-id 8ac7409e-a3e0-4ceb-aab7-3d6c985c02fe
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30880072
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
282f8724:30602487
89544117:30613380
vscrp:30673768
showlangstatbar:30737416
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
welcomedialogc:30887144
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
synctok:30869157
dsvsc013:30795093
dsvsc014:30804076
dsvsc015:30845448
pythontestfixt:30871694
pythonregdiag2:30871582
pyreplss1:30886140
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
accentitlementsc:30887149
dsvsc016:30886110
dsvsc017cf:30886113
dsvsc018cf:30886115
aa_t_chat:30882232

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Nov 16, 2023
@karrtikr
Copy link

Please provide the debug logs which can help diagnose the issue:

  • Run Developer: Set log level command
  • Select Trace
  • Run Developer: Reload Window command
  • Provide the output:
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Nov 16, 2023
@dcgudeman
Copy link
Author

2023-11-16 19:22:20.673 [info] Interpreter from setting black-formatter.interpreter: .venv/bin/python 2023-11-16 19:22:20.673 [info] Interpreter from setting black-formatter.interpreter: .venv/bin/python 2023-11-16 19:22:20.673 [info] Interpreter from setting black-formatter.interpreter: .venv/bin/python 2023-11-16 19:22:20.673 [info] Interpreter from setting black-formatter.interpreter: .venv/bin/python 2023-11-16 19:22:20.673 [info] Interpreter from setting black-formatter.interpreter: .venv/bin/python 2023-11-16 19:22:20.673 [info] Interpreter from setting black-formatter.interpreter: .venv/bin/python 2023-11-16 19:22:20.673 [info] Server run command: .venv/bin/python /Users/davidgudeman/.vscode/extensions/ms-python.black-formatter-2023.6.0/bundled/tool/lsp_server.py 2023-11-16 19:22:20.673 [info] Server: Start requested. 2023-11-16 19:22:20.673 [debug] Server State: Starting 2023-11-16 19:22:20.673 [debug] Server State: Stopped 2023-11-16 19:22:20.673 [info] [Error - 7:22:20 PM] Black Formatter client: couldn't create connection to server. 2023-11-16 19:22:20.673 [info] Launching server using command .venv/bin/python failed. Error: spawn .venv/bin/python ENOENT 2023-11-16 19:22:20.673 [error] Server: Start failed: Launching server using command .venv/bin/python failed. Error: spawn .venv/bin/python ENOENT

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Nov 17, 2023
@karrtikr
Copy link

Try Python: Clear cache and reload command

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Nov 17, 2023
@dcgudeman
Copy link
Author

@karrtikr Do you honestly believe I haven't tried that?

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Nov 17, 2023
@karrtikr
Copy link

Your issue is likely a dup of #22460, where specifying relative paths directly is not working: .venv/bin/python. What is the full path to your .venv/bin/python? Does each workspace have its own venv?

Try selecting absolute path explicitly using Python: Select Interpreter -> Enter interpreter path and then typing

${workspaceFolder:<workspacefoldername>}/.venv/bin/python

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Nov 17, 2023
Copy link

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.

Happy Coding!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants