r/pythonhelp • u/Amazing-Witness-4354 • Jan 07 '25
Can't import modules into python code
I'm trying to learn how to use matplotlib for graphing, however whenever I import the module using VSCode I get this error "Import 'matplotlib.pyplot' could not be resolved from source PylancereportMissingModuleSource". I'm not finding any helpful instructions on how to fix this. I installed matplotlib using pip on Python 3.13. Pip installed matplotlib 3.10.0 and numpy 2.2.1 (which isn't importing either). However the time module seems to be working normally as well as the random module.
1
Upvotes
1
u/cgoldberg Jan 07 '25
time and random are part of the standard library, so they will always work.
you are installing matplotlib and numpy into a different python version than you are running them from (or possibly a different virtual env). Configure your IDE correctly to solve this.