Cannot install pip (matplotlib) on windows in pycharm
Question:
tried program
import matplotlib.pyplot as plt
import numpy as np
xpoints = np.array([1, 8])
ypoints = np.array([3, 10])
plt.plot(xpoints, ypoints)
plt.show()
pip is now installed, after reading michael s question
the "pip install matplotlib " works
however the same thing python error is occuring
C:UsersM0182965PycharmProjectsEMC2.00venvScriptspython.exe C:/Users/M0182965/PycharmProjects/EMC2.00/main.py
Traceback (most recent call last):
File "C:UsersM0182965PycharmProjectsEMC2.00main.py", line 1, in <module>
import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'
Process finished with exit code 1
Answers:
Try adding pip
to your environment variables. Press your Windows icon on your keyboard, then start typing "variables". Click on "Edit environment variables" (pictured below):
In your environment variables, click on "Path" then click "Edit". In the edit window, click "New" then paste your path to your pip executable, which looks to be C:UsersM0182965AppDataLocalProgramsPythonPython39Scripts
. Look at my path as an example (the highlighted one is where my pip executable is):
Then just keep hitting "Ok" until you’re out of all the windows. Open a fresh terminal and try pip install
again. You shouldn’t have to restart your computer but try it if the above doesn’t work.
tried program
import matplotlib.pyplot as plt
import numpy as np
xpoints = np.array([1, 8])
ypoints = np.array([3, 10])
plt.plot(xpoints, ypoints)
plt.show()
pip is now installed, after reading michael s question
the "pip install matplotlib " works
however the same thing python error is occuring
C:UsersM0182965PycharmProjectsEMC2.00venvScriptspython.exe C:/Users/M0182965/PycharmProjects/EMC2.00/main.py
Traceback (most recent call last):
File "C:UsersM0182965PycharmProjectsEMC2.00main.py", line 1, in <module>
import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'
Process finished with exit code 1
Try adding pip
to your environment variables. Press your Windows icon on your keyboard, then start typing "variables". Click on "Edit environment variables" (pictured below):
In your environment variables, click on "Path" then click "Edit". In the edit window, click "New" then paste your path to your pip executable, which looks to be C:UsersM0182965AppDataLocalProgramsPythonPython39Scripts
. Look at my path as an example (the highlighted one is where my pip executable is):
Then just keep hitting "Ok" until you’re out of all the windows. Open a fresh terminal and try pip install
again. You shouldn’t have to restart your computer but try it if the above doesn’t work.