Reputation: 71
As seen in the title, I need some help installing NumPy using the official python IDLE. I am running Windows 10 on a Dell computer and I am not sure where to start. I have read through a very similar thread (How do I use Numpy in Python IDLE?) and have not found the help I need. Problem: In many tutorials (Including the official NumPy website), it says to enter: pip install numpy
HOWEVER... I am extremely confused as to where to put this. When I enter this into IDLE, it errors out and says, SyntaxError: invalid syntax
. Import numpy as np
doesn't work either, instead, I receive a different error: Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> import numpy as np ModuleNotFoundError: No module named 'numpy'
. Please could somebody help me from the beginning. Thank you.
Upvotes: 4
Views: 55137
Reputation: 11
We can't Install Python Modules Using "Python IDLE".The only Way to Install Modules is Using "Command Prompt".Try to type pip install numpy in command prompt(If it shows error try again by opening command prompt as Adminstrator).
If Pip is not installed, you will get an error message stating that the program is not found. To Install Pip Follow the steps:
1.Download get-pip.py(https://bootstrap.pypa.io/get-pip.py) to a folder on your computer.
2.Open a command prompt and navigate to the folder containing the get-pip.py installer.
3.Run the command: python get-pip.py
We can now verify that Pip was installed correctly by opening a command prompt and entering the command: pip -V
If you didn't get any error message then pip is installed Correctly. Now type pip install numpy in command prompt.
And now Numpy will be installed correctly and we are good to go :)
Thank You.
Upvotes: 1
Reputation: 614
You have to install numpy from Command Prompt, not IDLE.
Follow these steps on Windows:
NOTE: In case you get a message saying "pip" is not recognized, refer to: https://stackoverflow.com/a/56678271/13699502
Upvotes: 9
Reputation: 822
You write pip install numpy
in the command prompt (CMD)
if you are on Windows.
And, most of the times py -m pip install numpy
helps more on Windows.
On macOS/Unix, you can use python -m pip install numpy
in terminal/console.
Upvotes: 1