Skip to content

Discovering python interpreters never finishes due to presence of symbolic link loop #21310

Description

@HoytXU

Type: Bug

Vscode Version: Visual Studio Code Insiders
Extensions: Copilot Nightly, Copilot chat, Python, Pylance (Only these)

I've reviewed the former similar issues, but they can't solve my problem(sad).
I tried to set python.logging.level to "debug", but it says this setting is deprecated. So the following is the only information I got.

output -> python:
2023-05-27 15:19:22.087 [info] Experiment 'pythonPromptNewFormatterExt' is active
2023-05-27 15:19:22.088 [info] Experiment 'pythonPromptNewToolsExt' is active
2023-05-27 15:19:22.088 [info] Test server listening.
2023-05-27 15:19:22.088 [info] > conda info --json
2023-05-27 15:20:11.876 [error] Autoselection timeout out, this is likely a issue with how consumer called execution factory API. Using default python to execute.
2023-05-27 15:20:11.898 [info] > python -c "import sys;print(sys.executable)"
2023-05-27 15:20:12.000 [error] Autoselection timeout out, this is likely a issue with how consumer called execution factory API. Using default python to execute.

Extension version: 2023.9.11461009
VS Code version: Code - Insiders 1.79.0-insider (2dfb838, 2023-05-26T05:22:45.569Z)
OS version: Windows_NT x64 10.0.22621
Modes: Unsupported
Remote OS version: Linux x64 5.19.0-41-generic

System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i5-12500H (16 x 3110)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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) undefined
Memory (System) 15.64GB (6.49GB free)
Process Argv --crash-reporter-id 19921559-5588-4c15-90c1-006c63d2772a --crash-reporter-id 19921559-5588-4c15-90c1-006c63d2772a
Screen Reader no
VM 0%
Item Value
Remote SSH: DstGPU
OS Linux x64 5.19.0-41-generic
CPUs Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz (48 x 1200)
Memory (System) 251.78GB (214.46GB free)
VM 0%
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256198
vslsvsres303:30308271
pythontb:30258533
vsc_aacf:30263846
pythonptprofiler:30281269
vshan820:30294714
vscod805:30301674
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30404738
cppdebug:30492333
vsclangdf:30492506
c4g48928:30535728
dsvsc012:30540252
pynewext54:30618038
pylantcb52:30590116
pyind779:30611226
pythonsymbol12:30651887
2i9eh265:30646982
showlangstatbar:30737417
pythonms35:30671666
03d35959:30680466
ecj1e332:30687743
pythonfmttext:30716741
pythoncmvfstr:30726892
fixshowwlkth:30724385
showsbindicator:30724477
pythongtdpath:30726887

Activity

  1. HoytXU commented on May 27, 2023

    @HoytXU
    Author

    If you need any more information to solve the problem, please let me know. Thank you so much.

  2. HoytXU commented on May 27, 2023

    @HoytXU
    Author

    If I run conda info --json and python -c "import sys;print(sys.executable)" in a terminal, I get these output. (If these can help)
    After I run conda info --json, I press ctrl c to run the next command.
    (base) liuyx@gpu1:~$ conda info --json
    {
    "GID": 1104,
    "UID": 1104,
    "active_prefix": "/data2/users/liuyx/anaconda3",
    "active_prefix_name": "base",
    "av_data_dir": "/data2/users/liuyx/anaconda3/etc/conda",
    "av_metadata_url_base": null,
    "channels": [
    "https://repo.anaconda.com/pkgs/main/linux-64",
    "https://repo.anaconda.com/pkgs/main/noarch",
    "https://repo.anaconda.com/pkgs/r/linux-64",
    "https://repo.anaconda.com/pkgs/r/noarch"
    ],
    "conda_build_version": "3.22.0",
    "conda_env_version": "23.3.1",
    "conda_location": "/data2/users/liuyx/anaconda3/lib/python3.9/site-packages/conda",
    "conda_prefix": "/data2/users/liuyx/anaconda3",
    "conda_shlvl": 1,
    "conda_version": "23.3.1",
    "config_files": [],
    "default_prefix": "/data2/users/liuyx/anaconda3",
    "env_vars": {
    "CIO_TEST": "",
    "CONDA_DEFAULT_ENV": "base",
    "CONDA_EXE": "/data2/users/liuyx/anaconda3/bin/conda",
    "CONDA_PREFIX": "/data2/users/liuyx/anaconda3",
    "CONDA_PROMPT_MODIFIER": "(base) ",
    "CONDA_PYTHON_EXE": "/data2/users/liuyx/anaconda3/bin/python",
    "CONDA_ROOT": "/data2/users/liuyx/anaconda3",
    "CONDA_SHLVL": "1",
    "CURL_CA_BUNDLE": "",
    "LD_LIBRARY_PATH": "/data2/users/liuyx/cuda-11.6/lib64:/usr/lib:/lib/x86_64-linux-gnu:/data2/users/liuyx/cuda-11.6/lib64:/usr/lib:/lib/x86_64-linux-gnu:",
    "LD_PRELOAD": "",
    "PATH": "/data2/users/liuyx/cuda-11.6/bin:/data2/users/liuyx/.vscode-server-insiders/bin/2dfb838f494f035099e999f0cd0eff5f1f488a30/bin/remote-cli:/data2/users/liuyx/cuda-11.6/bin:/data2/users/liuyx/anaconda3/bin:/data2/users/liuyx/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
    "REQUESTS_CA_BUNDLE": "",
    "SSL_CERT_FILE": ""
    },
    "envs": [
    "/data2/users/liuyx/anaconda3",
    "/data2/users/liuyx/anaconda3/envs/Project"
    ],
    "envs_dirs": [
    "/data2/users/liuyx/anaconda3/envs",
    "/data2/users/liuyx/.conda/envs"
    ],
    "netrc_file": null,
    "offline": false,
    "pkgs_dirs": [
    "/data2/users/liuyx/anaconda3/pkgs",
    "/data2/users/liuyx/.conda/pkgs"
    ],
    "platform": "linux-64",
    "python_version": "3.9.13.final.0",
    "rc_path": "/data2/users/liuyx/.condarc",
    "requests_version": "2.28.1",
    "root_prefix": "/data2/users/liuyx/anaconda3",
    "root_writable": true,
    "site_dirs": [],
    "sys.executable": "/data2/users/liuyx/anaconda3/bin/python",
    "sys.prefix": "/data2/users/liuyx/anaconda3",
    "sys.version": "3.9.13 (main, Aug 25 2022, 23:26:10) \n[GCC 11.2.0]",
    "sys_rc_path": "/data2/users/liuyx/anaconda3/.condarc",
    "user_agent": "conda/23.3.1 requests/2.28.1 CPython/3.9.13 Linux/5.19.0-41-generic ubuntu/22.04.1 glibc/2.35",
    "user_rc_path": "/data2/users/liuyx/.condarc",
    "virtual_pkgs": [
    [
    "__archspec",
    "1",
    "x86_64"
    ],
    [
    "__glibc",
    "2.35",
    "0"
    ],
    [
    "__linux",
    "5.19.0",
    "0"
    ],
    [
    "__unix",
    "0",
    "0"
    ]
    ]
    }

    (base) liuyx@gpu1:~$ python -c "import sys;print(sys.executable)"
    /data2/users/liuyx/anaconda3/bin/python

  3. karrtikr commented on May 30, 2023

    @karrtikr

    Thanks for the bug report! We investigate issues in order based on priority and severity, which includes the impact it has on your ability to use the extension to do productive work, and the number of people affected. If other users come forward and leave a comment demonstrating they are seeing/reproducing the problem then we will raise this issue's priority. Thanks for understanding and the patience!

  4. sachit-menon commented on May 31, 2023

    @sachit-menon

    I have a similar issue where "Discovering Python Interpreters" goes on forever, meaning Copilot is never initialized, making it useless. I'm on a Mac using Remote-SSH into a Linux machine. Here is my debug panel:

    2023-05-31 18:48:29.306 [info] Experiment 'pythonPromptNewFormatterExt' is active
    2023-05-31 18:48:29.306 [info] Experiment 'pythonPromptNewToolsExt' is active
    2023-05-31 18:48:29.306 [info] Test server listening.
    2023-05-31 18:48:29.306 [info] > conda info --json
    2023-05-31 18:48:29.306 [info] Python interpreter path: ~/mambaforge/envs/ag3/bin/python
    2023-05-31 18:48:29.306 [info] Found: /bin/python --> /bin/python2.7
    2023-05-31 18:48:29.306 [info] Found: /bin/python2 --> /bin/python2.7
    2023-05-31 18:48:29.306 [info] Found: /bin/python2.7 --> /bin/python2.7
    2023-05-31 18:48:29.306 [info] Found: /bin/python3 --> /bin/python3.8
    2023-05-31 18:48:29.306 [info] Found: /bin/python3.8 --> /bin/python3.8
    2023-05-31 18:48:29.306 [info] Found: /usr/bin/python --> /usr/bin/python2.7
    2023-05-31 18:48:29.306 [info] Found: /usr/bin/python2 --> /usr/bin/python2.7
    2023-05-31 18:48:29.312 [info] Found: /usr/bin/python2.7 --> /usr/bin/python2.7
    2023-05-31 18:48:29.313 [info] Found: /usr/bin/python3 --> /usr/bin/python3.8
    2023-05-31 18:48:29.314 [info] Found: /usr/bin/python3.8 --> /usr/bin/python3.8
    2023-05-31 18:48:29.353 [info] Found: /data/home/sachit/mambaforge/bin/python --> /data/home/sachit/mambaforge/bin/python3.10
    2023-05-31 18:48:29.358 [info] Found: /data/home/sachit/mambaforge/bin/python3 --> /data/home/sachit/mambaforge/bin/python3.10
    2023-05-31 18:48:29.362 [info] Found: /data/home/sachit/mambaforge/bin/python3.1 --> /data/home/sachit/mambaforge/bin/python3.10
    2023-05-31 18:48:29.362 [info] Found: /data/home/sachit/mambaforge/bin/python3.10 --> /data/home/sachit/mambaforge/bin/python3.10
    2023-05-31 18:48:29.427 [info] > /bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    2023-05-31 18:48:29.577 [warning] Error: Command failed: /bin/python -I /data/home/sachit/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py /data/home/sachit/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    Unknown option: -I
    usage: /bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
    Try `python -h' for more information.
    
        at ChildProcess.exithandler (node:child_process:400:12)
        at ChildProcess.emit (node:events:513:28)
        at maybeClose (node:internal/child_process:1093:16)
        at Socket.<anonymous> (node:internal/child_process:451:11)
        at Socket.emit (node:events:513:28)
        at Pipe.<anonymous> (node:net:757:14) {
      code: 2,
      killed: false,
      signal: null,
      cmd: '/bin/python -I /data/home/sachit/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py /data/home/sachit/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py'
    }
    2023-05-31 18:48:29.577 [error] Support for Python 2.7 has been dropped by the Python extension so certain features may not work, upgrade to using Python 3.
    2023-05-31 18:48:29.598 [info] > /bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    2023-05-31 18:48:29.645 [info] > /bin/python3 -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    2023-05-31 18:48:29.689 [info] > /usr/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    2023-05-31 18:48:29.753 [warning] Error: Command failed: /usr/bin/python -I /data/home/sachit/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py /data/home/sachit/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    Unknown option: -I
    usage: /usr/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
    Try `python -h' for more information.
    
        at ChildProcess.exithandler (node:child_process:400:12)
        at ChildProcess.emit (node:events:513:28)
        at maybeClose (node:internal/child_process:1093:16)
        at Socket.<anonymous> (node:internal/child_process:451:11)
        at Socket.emit (node:events:513:28)
        at Pipe.<anonymous> (node:net:757:14) {
      code: 2,
      killed: false,
      signal: null,
      cmd: '/usr/bin/python -I /data/home/sachit/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py /data/home/sachit/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py'
    }
    2023-05-31 18:48:29.753 [error] Support for Python 2.7 has been dropped by the Python extension so certain features may not work, upgrade to using Python 3.
    2023-05-31 18:48:29.769 [info] > /usr/bin/python ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    2023-05-31 18:48:29.816 [info] > /usr/bin/python3 -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    2023-05-31 18:48:36.661 [info] > conda run -n ag3 --no-capture-output python ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/printEnvVariables.py
    2023-05-31 18:48:36.662 [info] shell: bash
    2023-05-31 18:48:36.662 [info] > conda run -n ag3 --no-capture-output python ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/printEnvVariables.py
    2023-05-31 18:48:36.662 [info] shell: bash
    2023-05-31 18:48:36.683 [info] > ~/mambaforge/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    2023-05-31 18:48:36.707 [info] > ~/mambaforge/envs/ag3/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    2023-05-31 18:48:36.709 [info] Send text to terminal: conda activate ag3
    2023-05-31 18:48:36.893 [info] > ~/mambaforge/envs/din/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    2023-05-31 18:48:37.609 [info] > ~/mambaforge/envs/mg/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    2023-05-31 18:48:37.973 [info] > ~/mambaforge/envs/pyt/bin/python -I ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.9.11461009/pythonFiles/interpreterInfo.py
    
  5. amit9oct commented on Jun 20, 2023

    @amit9oct

    Hi,
    I'm facing the exact same issues. "Discovering Python Interpreters" never finishes. The following are the logs from the Python Extension:

    2023-06-20 06:54:22.520 [info] Test server listening.
    2023-06-20 06:54:22.520 [info] > ~/miniconda3/condabin/conda info --json
    2023-06-20 06:54:22.520 [info] Found: /bin/python3 --> /bin/python3.10
    2023-06-20 06:54:22.520 [info] Found: /bin/python3.10 --> /bin/python3.10
    2023-06-20 06:54:22.520 [info] Found: /usr/bin/python3 --> /usr/bin/python3.10
    2023-06-20 06:54:22.520 [info] Found: /usr/bin/python3.10 --> /usr/bin/python3.10
    2023-06-20 06:54:22.520 [info] Found: /home/amthakur/miniconda3/bin/python --> /home/amthakur/miniconda3/bin/python3.10
    2023-06-20 06:54:22.520 [info] Found: /home/amthakur/miniconda3/bin/python3 --> /home/amthakur/miniconda3/bin/python3.10
    2023-06-20 06:54:22.520 [info] Found: /home/amthakur/miniconda3/bin/python3.1 --> /home/amthakur/miniconda3/bin/python3.10
    2023-06-20 06:54:22.520 [info] Found: /home/amthakur/miniconda3/bin/python3.10 --> /home/amthakur/miniconda3/bin/python3.10
    2023-06-20 06:54:22.520 [info] > /bin/python3 -I ~/.vscode-server/extensions/ms-python.python-2023.10.1/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2023.10.1/pythonFiles/interpreterInfo.py
    2023-06-20 06:54:22.520 [info] > /usr/bin/python3 -I ~/.vscode-server/extensions/ms-python.python-2023.10.1/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2023.10.1/pythonFiles/interpreterInfo.py
    
  6. bicepjai commented on Jul 3, 2023

    @bicepjai

    I am facing the same issue

    Version: 1.79.2
    Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06
    Date: 2023-06-14T08:58:33.551Z (2 wks ago)
    Electron: 22.5.7
    Chromium: 108.0.5359.215
    Node.js: 16.17.1
    V8: 10.8.168.25-electron.0
    OS: Darwin arm64 22.5.0
    
  7. gravic07 commented on Jul 8, 2023

    @gravic07

    +1

  8. Anutlet commented on Jul 12, 2023

    @Anutlet

    +1

  9. Zsirl commented on Jul 13, 2023

    @Zsirl

    me too.
    Discovering python interpreters forever!

  10. karrtikr commented on Jul 13, 2023

    @karrtikr

    Hi all, please provide the debug logs which can help diagnose the issue:

    • Run Developer: Set log level command
    • Select Python -> Select Trace
    • Run Developer: Reload Window command

    After which, please provide the logs:

    Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

    XXX
    

  11. 51 remaining items

  12. added
    bugIssue identified by VS Code Team member as probable bug
    area-environmentsFeatures relating to handling interpreter environments
    needs PRReady to be worked on
    and removed
    info-neededIssue requires more information from poster
    triage-neededNeeds assignment to the proper sub-team
    on Jul 19, 2023
  13. karrtikr commented on Jul 25, 2023

    @karrtikr

    LachlanGreen Fix should be out, let me know if that helps.

  14. amunger commented on Jul 27, 2023

    @amunger

    got it to repro in stable, and not in insiders 👍

  15. locked as resolved and limited conversation to collaborators on Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsFeatures relating to handling interpreter environmentsauthor-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions