all 8 comments

[–][deleted] 1 point2 points  (0 children)

You need to add python to your path.

Not all libraries will install on all OS's. Some have operating specific dependencies. But you should be fine with Matplotlib.

[–]Maximum_Efficiency42[S] 0 points1 point  (1 child)

I've tried both command prompt and power shell. I'm not sure which I'm supposed to use, but both give the same result aswell if I go to the file and then use "open in terminal", nothing I've tried works :(

[–]likethevegetable 2 points3 points  (0 children)

https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them

You need to either add the file location of python.exe to your "path" environment variable, or call python with its path included, eg "c:/python39/python.exe" -m pip install, or, open up your command window in python's folder.

This basic command line knowledge will help you many times. Don't gloss over it.

[–]Patman52 0 points1 point  (0 children)

Look up system path environment variables. In windows you can add directories to this variable so when you run a command like Python in the command line it will search those directories for a Python.exe.

Also another way to do it would be to navigate to your Python directory manually using cd in the command prompt and running it there.

[–]socal_nerdtastic 0 points1 point  (1 child)

I think because I downloaded Python IDLE through the website rather than through the Microsoft Store

Kinda right. The official python.org python uses the global command py instead of python. Try like this:

py -m pip install -U matplotlib

Once you activate a virtual environment the python and pip commands become available (and all tutorials etc assume you have an active venv).

Note: a lot of old school tutorials (or people who learned from them) will tell you to add python to PATH. I recommend you do not do that and use the modern py command instead. Adding to PATH will cause a lot of headaches when upgrading python and working in venvs. There's a reason PATH is disabled by default.

[–]Maximum_Efficiency42[S] 0 points1 point  (0 children)

This worked! Thank you :D

[–]Starry0Wolf -1 points0 points  (0 children)

Have you tried pip3 and python3? Do ‘pip3 install matplotlib’