简体   繁体   中英

Matplotlib works in my IDE, but not through cmd?

I've installed matplotlib through pip , and it runs perfectly when I use it in PyCharm . However, when I run my Python file through cmd, I get the following error message:

ModuleNotFoundError: No module named 'matplotlib'

I have installed other modules the same way, and those have no problems running in PyCharm or in cmd.

Matplotlib is installed under:

C:\\Users\\David\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages

Something I noticed - perhaps the root of the problem - Is that Python seems to be installed in 2 places:

C:\\Users\\David\\AppData\\Local\\Programs\\Python\\Python38-32\\python.exe

The path above is also the path to my Python Interpreter on PyCharm .

and

C: \\Users\\David\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe

  • Python version 3.8.5
  • Windows 10

Thanks in advance!

try running the command pip install matplotlib in your cmd. It works for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM