DonJayamanne / vscode-python-manager

Python Environment & Package Manager
MIT License
121 stars 21 forks source link

Extension can't display any environments #59

Closed ssslakter closed 1 year ago

ssslakter commented 1 year ago

Type: Bug

Behaviour

Expected vs. Actual

The extension should show available python environments. But the actual behaviour is that I see empty lists in the python envinonment manager explorer window, and notification with error saying.

Error running command python.envManager.refresh: command 'python.envManager.refresh' not found. This is likely caused by the extension that contributes python.envManager.refresh.

image

Steps to reproduce:

  1. Start vscode
  2. Open python envinonment manager explorer

Diagnostic data

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

``` Debug: Finished searching for workspace virtual envs Error: TypeError: c.toCommandArgumentForPythonExt is not a function at c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:98 at Array.reduce () at getInterpreterInfo (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:25) at WorkerPool.buildEnvironmentInfo [as workerFunc] (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:10893:72) at Worker.workFunc (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7544:88) at Worker.start (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7462:47) Error: TypeError: c.toCommandArgumentForPythonExt is not a function at c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:98 at Array.reduce () at getInterpreterInfo (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:25) at WorkerPool.buildEnvironmentInfo [as workerFunc] (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:10893:72) at Worker.workFunc (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7544:88) at Worker.start (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7462:47) Error: TypeError: c.toCommandArgumentForPythonExt is not a function at c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:98 at Array.reduce () at getInterpreterInfo (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:25) at WorkerPool.buildEnvironmentInfo [as workerFunc] (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:10893:72) at Worker.workFunc (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7544:88) at Worker.start (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7462:47) Debug: Finished searching for windows registry interpreters Debug: Couldn't locate the conda binary. Debug: Couldn't locate the conda binary. Debug: Finished with environment reducer Error: TypeError: c.toCommandArgumentForPythonExt is not a function at c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:98 at Array.reduce () at getInterpreterInfo (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:25) at WorkerPool.buildEnvironmentInfo [as workerFunc] (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:10893:72) at Worker.workFunc (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7544:88) at Worker.start (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7462:47) Error: TypeError: c.toCommandArgumentForPythonExt is not a function at c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:98 at Array.reduce () at getInterpreterInfo (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:25) at WorkerPool.buildEnvironmentInfo [as workerFunc] (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:10893:72) at Worker.workFunc (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7544:88) at Worker.start (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7462:47) Error: TypeError: c.toCommandArgumentForPythonExt is not a function at c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:98 at Array.reduce () at getInterpreterInfo (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:25) at WorkerPool.buildEnvironmentInfo [as workerFunc] (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:10893:72) at Worker.workFunc (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7544:88) at Worker.start (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7462:47) at runNextTicks (node:internal/process/task_queues:60:5) at listOnTimeout (node:internal/timers:538:9) at processTimers (node:internal/timers:512:7) Error: TypeError: c.toCommandArgumentForPythonExt is not a function at c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:98 at Array.reduce () at getInterpreterInfo (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:25) at WorkerPool.buildEnvironmentInfo [as workerFunc] (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:10893:72) at Worker.workFunc (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7544:88) at Worker.start (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7462:47) Error: TypeError: c.toCommandArgumentForPythonExt is not a function at c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:98 at Array.reduce () at getInterpreterInfo (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:11191:25) at WorkerPool.buildEnvironmentInfo [as workerFunc] (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:10893:72) at Worker.workFunc (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7544:88) at Worker.start (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.1\out\client\extension.js:7462:47) Debug: Finished with environment resolver Debug: Environments added to cache [] ```

I have global interpreters of Python 3.9, 3.10 and 3.11 so it should at least find one of those, and several local venvs in project directories

User Settings

``` languageServer: "Pylance" ```

Extension version: 1.2.1 VS Code version: Code 1.82.0 (8b617bd08fd9e3fc94d14adb8d358b56e3f72314, 2023-09-06T22:07:07.438Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 5 3500 6-Core Processor (6 x 3593)| |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)|undefined| |Memory (System)|47.93GB (28.21GB free)| |Process Argv|--crash-reporter-id 8e529196-d597-417d-9db7-21dec6fb9c47| |Screen Reader|no| |VM|0%|
DonJayamanne commented 1 year ago

Oops, sorry about, that, shoudl be fixed now.

ssslakter commented 1 year ago

@DonJayamanne The problem seem not go away, now I have in logs version 1.2.2 but still get this error message. What I also discovered is that it only gets broken in the projects where I have .venv folder and for other where I have a folder name venv it works fine.

DonJayamanne commented 1 year ago

@Ssslakter please can you share the logs once again.

ssslakter commented 1 year ago

The logs are just show the debug this time, at least in Python Environments(logging) group.

logs ``` Debug: Getting roots Debug: Getting roots Debug: Found roots Debug: Start watching file for changes C:\Users\user\.conda\environments.txt Debug: Start watching: C:\Users\user\.conda with pattern environments.txt using VSCode API Debug: Searching for conda. Debug: Probing conda binary: conda Debug: Found roots Debug: Start watching root d:\Coding\Python\Voyager for globs ["python.exe","*/python.exe","*/Scripts/python.exe"] Debug: Start watching: d:\Coding\Python\Voyager with pattern python.exe using VSCode API Debug: Start watching: d:\Coding\Python\Voyager with pattern */python.exe using VSCode API Debug: Start watching: d:\Coding\Python\Voyager with pattern */Scripts/python.exe using VSCode API Debug: Dump environment variables { "ALLUSERSPROFILE": "C:\\ProgramData", "APPDATA": "C:\\Users\\user\\AppData\\Roaming", "CHROME_CRASHPAD_PIPE_NAME": "\\\\.\\pipe\\crashpad_11772_AWZGCHEDAOFFWDOX", "COMPUTERNAME": "DESKTOP-IA01OCT", "CUDA_PATH": "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.8", "CUDA_PATH_V11_8": "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.8", "ELECTRON_RUN_AS_NODE": "1", "FPS_BROWSER_APP_PROFILE_STRING": "Internet Explorer", "FPS_BROWSER_USER_PROFILE_STRING": "Default", "GIT_LFS_PATH": "C:\\Program Files\\Git LFS", "HOMEDRIVE": "C:", "HOMEPATH": "\\Users\\user", "LOCALAPPDATA": "C:\\Users\\user\\AppData\\Local", "LOGONSERVER": "\\\\DESKTOP-IA01OCT", "NUMBER_OF_PROCESSORS": "6", "NVTOOLSEXT_PATH": "C:\\Program Files\\NVIDIA Corporation\\NvToolsExt\\", "OPENCL_DIR": "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.8\\include", "OPENCL_LIB_X64": "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.8\\lib\\x64", "OPENCL_LIB_X86": "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.8\\lib\\Win32", "ORIGINAL_XDG_CURRENT_DESKTOP": "undefined", "OS": "Windows_NT", "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC", "POETRY_CONFIG_DIR": "C:\\Users\\user\\AppData\\Local\\Programs\\Python\\poetry", "PROCESSOR_ARCHITECTURE": "AMD64", "PROCESSOR_IDENTIFIER": "AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD", "PROCESSOR_LEVEL": "23", "PROCESSOR_REVISION": "7100", "PUBLIC": "C:\\Users\\Public", "SESSIONNAME": "Console", "TEMP": "C:\\Users\\user\\AppData\\Local\\Temp", "TMP": "C:\\Users\\user\\AppData\\Local\\Temp", "USERDOMAIN": "DESKTOP-IA01OCT", "USERDOMAIN_ROAMINGPROFILE": "DESKTOP-IA01OCT", "USERNAME": "user", "USERPROFILE": "C:\\Users\\user", "VSCODE_AMD_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess", "VSCODE_CODE_CACHE_PATH": "C:\\Users\\user\\AppData\\Roaming\\Code\\CachedData\\8b617bd08fd9e3fc94d14adb8d358b56e3f72314", "VSCODE_CRASH_REPORTER_PROCESS_TYPE": "extensionHost", "VSCODE_CWD": "C:\\WINDOWS\\System32", "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true", "VSCODE_IPC_HOOK": "\\\\.\\pipe\\8a8778358782e7cda5e3b905bc66e261-1.82.0-main-sock", "VSCODE_L10N_BUNDLE_LOCATION": "", "VSCODE_NLS_CONFIG": "{\"locale\":\"en\",\"osLocale\":\"ru\",\"availableLanguages\":{},\"_languagePackSupport\":true}", "VSCODE_PID": "11772", "ComSpec": "C:\\WINDOWS\\system32\\cmd.exe", "CommonProgramFiles": "C:\\Program Files\\Common Files", "CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files", "CommonProgramW6432": "C:\\Program Files\\Common Files", "DataGrip": "D:\\Software\\DataGrep\\DataGrip 2022.2.5\\bin;", "DriverData": "C:\\Windows\\System32\\Drivers\\DriverData", "OneDrive": "C:\\Users\\user\\OneDrive", "PSModulePath": "C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules", "ProgramData": "C:\\ProgramData", "ProgramFiles": "C:\\Program Files", "ProgramFiles(x86)": "C:\\Program Files (x86)", "ProgramW6432": "C:\\Program Files", "SystemDrive": "C:", "SystemRoot": "C:\\WINDOWS", "windir": "C:\\WINDOWS", "Path": "C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.8\\bin;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.8\\libnvvp;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\dotnet\\;C:\\Program Files\\nodejs\\;C:\\Program Files\\NVIDIA Corporation\\Nsight Compute 2022.3.0\\;C:\\Program Files\\Microsoft SQL Server\\150\\Tools\\Binn\\;C:\\Program Files\\Git LFS;C:\\Program Files\\Docker\\Docker\\resources\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.37.32822\\bin\\Hostx64\\x64;C:\\Program Files\\Git\\cmd;C:\\Users\\user\\scoop\\shims;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.8\\bin\\\\..\\extras\\CUPTI\\lib64;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.8\\bin;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.8\\libnvvp;C:\\Users\\user\\scoop\\apps\\curl\\current\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\dotnet\\;C:\\Program Files\\nodejs\\;C:\\Program Files\\NVIDIA Corporation\\Nsight Compute 2022.3.0\\;C:\\Program Files\\Microsoft SQL Server\\150\\Tools\\Binn\\;C:\\Program Files\\Git LFS;C:\\Program Files\\Git\\cmd;C:\\Users\\user\\.cargo\\bin;C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\Scripts\\;C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python311\\;C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python310\\Scripts\\;C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python310\\;C:\\Users\\user\\.dotnet\\tools;C:\\Users\\user\\AppData\\Local\\JetBrains\\Toolbox\\scripts;C:\\Users\\user\\AppData\\Local\\Programs\\Python\\poetry\\bin;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\OpenVPN Connect;C:\\Users\\user\\.dotnet\\tools" } Debug: Failed to spawn conda binary conda TypeError: e.trimQuotes(...).toCommandArgumentForPythonEnvMgrExt is not a function at c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.2\out\client\extension.js:3074:66 at Array.map () at ProcessLogger.logProcess (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.2\out\client\extension.js:3074:40) at ProcessService.emit (node:events:513:28) at ProcessService.exec (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.2\out\client\extension.js:3180:14) at exec (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.2\out\client\extension.js:15471:20) at Conda.getInfoImpl (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.2\out\client\extension.js:14425:24) at Function.locate (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.2\out\client\extension.js:14388:17) at getCondaVersion (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.2\out\client\extension.js:19841:19) at async Promise.all (index 0) at createInstallContext (c:\Users\user\.vscode\extensions\donjayamanne.python-environment-manager-1.2.2\out\client\extension.js:18750:39) Debug: Couldn't locate the conda binary. ```

Maybe there are more logs in some files, if you know where, I could also check them. The error pop-up is the same as in screenshot above

DonJayamanne commented 1 year ago

Should be ok now, please update to the latest version.

ssslakter commented 1 year ago

Sorry for the late response, but I still have the issue, now I tried running vscode on my ubuntu. I created a new workspace and opened python environments panel, and I got the same error as above, It shows none of my environments, even after I created a new venv inside the current project folder. Now, I guess, I see the problem, both times I had this extension installed in a separate vscode profile Then I tried switching to the default one and It worked out. Then created new empty profile and installed only the python environment extension and the problem reappeared, so I believe the fix should be somewhat related to vscode profiles