Skip to content

Can't get matplotlib in python to be recognized #282858

@FredMep

Description

@FredMep

Type: Performance Issue

I have installed Python (both from MS and Python) and then installed the package Matplotlib. However, now when I try to import it I get the error "No module named 'matplotlib' " and connot go futher.

I have added {"python.useEnvironmentsExtension": true} to the json module but that did not improve anything.

Any ideas as how to resolve this?

VS Code version: Code 1.107.0 (618725e, 2025-12-10T07:43:47.883Z)
OS version: Windows_NT x64 10.0.26200
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz (8 x 1190)
GPU Status 2d_canvas: enabled
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
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 11.75GB (1.05GB free)
Process Argv --crash-reporter-id 7ba33ae9-e9af-4595-8ac5-35b5dbd11b4d
Screen Reader no
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
    1	   140	 18760	code
    0	    74	  9548	file-watcher [1]
    0	    22	 11996	   crashpad-handler
    0	    36	 13916	   utility-network-service
    0	    95	 15616	shared-process
    1	   243	 16596	window [1] (TestImport1.py - Visual Studio Code)
    0	   126	 25912	   gpu-process
    0	   176	 28856	extension-host [1]
    0	    69	  4636	     "C:\Users\RHELenovo\AppData\Local\Programs\Microsoft VS Code\Code.exe" "c:\Users\RHELenovo\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\node\jsonServerMain" --node-ipc --clientProcessId=28856
    0	     7	 26904	     c:\Users\RHELenovo\.vscode\extensions\ms-python.vscode-python-envs-1.12.0-win32-x64\python-env-tools\bin\pet.exe server
    0	     6	 14576	       C:\WINDOWS\system32\conhost.exe 0x4
    0	   333	 29560	     electron-nodejs (bundle.js)
    0	     4	 31244	     C:\Users\RHELenovo\Documents\MyPythonEnvironment\.venv\Scripts\python.exe c:\Users\RHELenovo\.vscode\extensions\ms-python.debugpy-2025.16.0-win32-x64\bundled\libs\debugpy\adapter
    0	     7	  4760	       C:\WINDOWS\system32\conhost.exe 0x4
    0	    26	 26176	       "C:\Users\RHELenovo\AppData\Local\Programs\Python\Python312\python.exe" c:\Users\RHELenovo\.vscode\extensions\ms-python.debugpy-2025.16.0-win32-x64\bundled\libs\debugpy\adapter
    0	   102	 30132	pty-host
    0	    73	  7648	     C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "try { . \"c:\Users\RHELenovo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1\" } catch {}"
    0	     8	 19940	     conpty-agent
    0	     7	 21652	     conpty-agent
    0	     8	 29528	     conpty-agent
    0	     6	 30320	     C:\WINDOWS\System32\cmd.exe
    0	    76	 30724	     C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "try { . \"c:\Users\RHELenovo\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1\" } catch {}"
    0	     4	 31168	       "C:\Users\RHELenovo\Documents\MyPythonEnvironment\.venv\Scripts\python.exe" c:\Users\RHELenovo\.vscode\extensions\ms-python.debugpy-2025.16.0-win32-x64\bundled\libs\debugpy\launcher 50755 -- C:\Users\RHELenovo\MyCOde\TestImport1.py
    0	    26	 30880	         "C:\Users\RHELenovo\AppData\Local\Programs\Python\Python312\python.exe" c:\Users\RHELenovo\.vscode\extensions\ms-python.debugpy-2025.16.0-win32-x64\bundled\libs\debugpy\launcher 50755 -- C:\Users\RHELenovo\MyCOde\TestImport1.py
    0	     4	 21916	           C:\Users\RHELenovo\Documents\MyPythonEnvironment\.venv\Scripts\python.exe -X frozen_modules=off c:\Users\RHELenovo\.vscode\extensions\ms-python.debugpy-2025.16.0-win32-x64\bundled\libs\debugpy\launcher/../..\debugpy --connect 127.0.0.1:50754 --configure-qt none --adapter-access-token 4a4dda3f4fa980593c682b39de6df2688e84f137c6ebbe1036f4df2d59189105 C:\Users\RHELenovo\MyCOde\TestImport1.py
    0	    38	  8884	             "C:\Users\RHELenovo\AppData\Local\Programs\Python\Python312\python.exe" -X frozen_modules=off c:\Users\RHELenovo\.vscode\extensions\ms-python.debugpy-2025.16.0-win32-x64\bundled\libs\debugpy\launcher/../..\debugpy --connect 127.0.0.1:50754 --configure-qt none --adapter-access-token 4a4dda3f4fa980593c682b39de6df2688e84f137c6ebbe1036f4df2d59189105 C:\Users\RHELenovo\MyCOde\TestImport1.py
Workspace Info
;
Extensions (4)
Extension Author (truncated) Version
debugpy ms- 2025.16.0
python ms- 2025.20.0
vscode-pylance ms- 2025.10.4
vscode-python-envs ms- 1.14.0
A/B Experiments
vsliv368:30146709
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
aj953862:31281341
4f60g487:31327383
nes-set-on:31340697
6abeh943:31336334
envsactivate1:31353494
cloudbuttont:31379625
todos-1:31405332
3efgi100_wstrepl:31403338
trigger-command-fix:31379601
use-responses-api:31390855
anonusage:31403420
afag3459:31428711
ec5jj548:31422691
terminalsuggestenabled:31431119
cp_cls_t_966_ss:31426490
c0683394:31419495
478ah919:31426797
a5gib710:31426879
7a04d226_do_not_restore_last_panel_session:31432770
anthropic_thinking_t:31432745
406hc587_ask_agent:31428393
cp_cls_c_1081:31433293

Metadata

Metadata

Assignees

Labels

new releaseIssues found in a recent release of VS Code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions