You have to install numpy from Command Prompt, not IDLE.

Follow these steps on Windows:

  1. Press the Windows key on your keyboard.
  2. Type CMD and open Command Prompt. A black terminal should open up.
  3. Type 'pip install numpy' and hit enter.
  4. It should start the installation. After you see the "Successfully Installed" message, go back to your IDLE and try importing numpy, it should work.

NOTE: In case you get a message saying "pip" is not recognized, refer to: https://stackoverflow.com/a/56678271/13699502

Answer from Eshaan Gupta on Stack Overflow
🌐
DevGenius
blog.devgenius.io › how-to-install-numpy-in-python-idle-step-by-step-guide-587ff193c658
How to install Numpy in Python IDLE step-by-step guide | by Let's Decode | Dev Genius
March 4, 2024 - In summary, open your system shell or cmd, and type pip install numpy to install Numpy in Python, for confirmation, you can type the command pip show numpy in the terminal or you can go to Python IDLE and write import numpy as np and np.__version__.
Discussions

python - How to import/open numpy module to IDLE - Stack Overflow
I want to use numpy for a program I have to run and I want to do it in the IDLE IDE. I have installed the numpy binary from online, but when I try running "import numpy" and then some numpy commands in my script, but the python shell returns an error saying More on stackoverflow.com
🌐 stackoverflow.com
April 2, 2016
How to install numpy on IDLE opposed to terminal?
Your question should be "how to install numpy in python3", because that is the difference in your terminal (runs python2) and IDLE (runs python3). Try this (in the terminal): pip3 install numpy More on reddit.com
🌐 r/learnpython
2
1
December 16, 2015
No module name numpy in IDLE Shell but works in CMD
Multiple versions of Python installed? At the Python prompt in both the Command Prompt and in IDLE, type the following. What do you see? >>> import sys >>> sys.version >>> sys.executable More on reddit.com
🌐 r/learnpython
4
2
October 13, 2021
Using numpy in IDLE or PyCharm

If anyone gets here because they're looking for a similar answer, go here.

More on reddit.com
🌐 r/learnpython
8
2
August 18, 2015
🌐
YouTube
youtube.com › watch
How to Install Numpy in Python IDLE(Cinematic Title) | Numpy Install | JAcademy - YouTube
OUTSTANDING Python Handwritten Notes for Rs 30 only Link: https://bit.ly/3bkvIGDThis video is used to show how to install numpy in Python IDLE.
Published   September 20, 2021
🌐
Pickl
pickl.ai › home › python › how to install numpy in python idle?
How to Install NumPy in Python IDLE?
December 4, 2024 - NumPy enhances Python’s capabilities for efficient array handling and numerical computations. Ensure that pip is installed and that Python is compatible (version 3.7+) to avoid installation issues. Troubleshoot common problems, such as “pip not recognised,” by updating pip, fixing PATH variables, or using administrative privileges. Python IDLE (Integrated Development and Learning Environment) is a user-friendly platform with the standard Python installation.
🌐
YouTube
youtube.com › abhishek agarrwal
How to install numpy Library in Windows python IDLE and Jupyter Notebook - YouTube
Python tutorial on how to install numpy library in python windows idle and jupyter notebook.
Published   October 20, 2020
Views   110
Top answer
1 of 3
17

The title is misleading in the following sense. You do not want to import a module to IDLE. You want to import it to the python that is running your code. When running IDLE, this currently is the same python running IDLE. To find which python is running, the following should work anywhere on any recent python, either directly or in an IDE:

import sys; print(sys.executable)

Running this in IDLE on my Windows machine, I get

C:\Programs\Python36\pythonw.exe

(The w suffix is a Windows-specific variant binary for running GUI programs without an empty console window popping up. It should be omitted in what follows.)

To import a module to a particular python, it must be installed for that particular python. The easiest way to do that is to run pip with that particular python in a console. For instance, given the executable above:

C:\Programs\Python36> python -m pip install numpy

On *nix, one may have to first run, I believe, python -m ensurepip to install pip itself for that python.

About import pip; pip.main: pip is designed as a command line utility that initializes, performs one function, and exits. main() is an intentionally undocumented internal implementation detail. The author of pip discourages its use as it is designed for one call followed by program exit. Multiple calls will not work right when internal data get out of sync with installed files.

2 of 3
6

To install packages without affecting anaconda's configuration you can use pip from within IDLE:

import pip
pip.main(["install","numpy"])

In later versions this is no longer directly exposed, since doing this in production code is bad. but you can still import the internals to install a module.

from pip._internal.main import main as pip_main
pip_main(["install","numpy"])

Although because IDLE can be a little slow with refresh rate (at least it is on my mac) it can be a great speed boost to hide the output until the end:

import sys
import pip
import io

stdout_real = sys.stdout
sys.stdout = io.StringIO()
try:
    pip.main(["install","kfksnaf"])
finally:
    stdout_real.write(sys.stdout.getvalue())
    sys.stdout = stdout_real

note that this means that all standard output will be displayed after the error text which might be confusing if something goes wrong so do try it normally first and only do this if it lags badly.

On the other hand, it seems like anaconda has commandeered a lot of the functionalities of the python installed from python.org, to reduce it's impact on your machine you should take a look at Use Default Python Rather than Anaconda Installation When Called from the Terminal although this might then break functionalities of anaconda which may then in turn make it difficult to switch back if you want to do so.

🌐
Reddit
reddit.com › r/learnpython › how to install numpy on idle opposed to terminal?
r/learnpython on Reddit: How to install numpy on IDLE opposed to terminal?
December 16, 2015 -

My Mac OS terminal is running 2.7.10 and my IDLE shell is 3.4.3. I want to get numpy working on my IDLE shell, but I don't understand how to link it correctly. I have homebrew and I ran pip install numpy which I verified installed correctly but only on the terminal Python, it's not recognized by the IDLE. Do i have to change some paths around or something? How do I get numpy on IDLE?

Find elsewhere
🌐
Saturn Cloud
saturncloud.io › blog › how-to-install-numpy-using-official-python-idle-a-comprehensive-guide
How to Install NumPy Using Official Python IDLE: A Guide | Saturn Cloud Blog
October 4, 2023 - Type the following command in your Python IDLE shell: ⚠ This code is experimental content and was generated by AI. Please refer to this code as experimental only since we cannot currently guarantee its validity ... This command tells pip to download and install the NumPy package.
🌐
Reddit
reddit.com › r/learnpython › no module name numpy in idle shell but works in cmd
r/learnpython on Reddit: No module name numpy in IDLE Shell but works in CMD
October 13, 2021 -

I installed numpy on a windows 10 machine with pip in the Python directory, when I run my program in the shell it says tha there is a "ModuleNotFoundError: No module named 'numpy'" But when I run the script in Command Prompt numpy has been installed. Do i need to install numpy to the folder where my script is or something?

🌐
Reddit
reddit.com › r › learnpython › comments › 3hgqt4 › using_numpy_in_idle_or_pycharm
r/learnpython - Using numpy in IDLE or PyCharm
August 18, 2015 -

[SOLVED] Hey,

I just wrote a script for some research I'm doing using numpy, but I am only able to execute while running python in Terminal. Whenever I try executing in pycharm or IDLE, I get the following error when trying to execute:

import numpy as np

ImportError: No module named numpy

I've downloaded numpy, but I don't know how to install it such that it will be importable in these IDE's.

🌐
MIT
web.mit.edu › 6.149 › www › materials › checkoff1 › install_guide.pdf pdf
Getting Started With Python
environment we will be using throughout this course. It will also show you how to install the Python · library packages matplotlib and numpy which will be used later in this class to work with graphs. ... Python should be set up correctly on the Linux athena machines. Type 'idle' at the command
🌐
WPI Computer Science
web.cs.wpi.edu › ~cs1004 › a16 › Resources › Windows › SettingUpPython_Windows.pdf pdf
Setting up Python 3.5, numpy, and matplotlib on your own Windows ...
This will upgrade the pip program and · output something along the following lines in the command prompt window:– · C:�sers\Hugh\Desktop\My Downloads>pip install --upgrade pip ... It may then report an error with a lot of error output, all of which which you may safely ignore.
🌐
Besant Technologies
besanttechnologies.com › home › blogs › general › how to install numpy in python?
How To Install NumPy in Python | NumPy Installation
January 5, 2024 - NumPy is a library of Python programming language.This blog will provide you step by step process of How To Install NumPy in Python on different operating systems.
Top answer
1 of 1
3

Firstly, you might already know that Anaconda comes with its own free IDE, very similar to IDLE in many respects. It's known as Spyder, and should be accessible in any terminal as: spyder. You could stop reading at this point and use that.

But if you really want to use IDLE, you'll need to track it down first. It's bundled with each distribution of Python that you have installed on your system. For example, I have a version of IDLE installed at the following location:

/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib/python3.3/idlelib/idle.pyw

If I run the Python distribution that this copy of IDLE belongs to, I can't access NumPy, because I've never installed it in that distribution:

python3
...
>>> import numpy as np
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'

I do have NumPy installed in my Canopy version of Python though (Canopy is very similar to Anaconda).

python
...
>>> import numpy as np
>>>

The workaround I can do to get NumPy in the console is this:

python /usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/lib/python3.3/idlelib/idle.pyw

I'm executing the Canopy distribution of Python, which does have NumPy installed, and calling the other Python distribution's IDLE as you would any script. Then the IDLE console pops up and does allow me to import and use NumPy.

This is bit of a workaround and I have found it to be hit-and-miss. When I use Canopy's Python to open the IDLE belonging to yet another distribution of Python (Python 2.7 installed through Homebrew), I sometimes get the following error when using the print statement:

Unknown object id: 'console'

So just be aware that you could run into issues like that.

🌐
Saturn Cloud
saturncloud.io › blog › how-to-import-numpy-to-python-idle-27-on-windows-a-comprehensive-guide
How to Import NumPy to Python IDLE 2.7 on Windows: A Comprehensive Guide | Saturn Cloud Blog
September 9, 2023 - Open Python IDLE, and type: ... This command imports the NumPy library and assigns it to the alias ‘np’. This is a common practice as it saves us from typing ‘numpy’ every time we want to use a function from the library. To ensure that NumPy has been correctly installed and imported, let’s perform a simple operation. In ...
🌐
Reddit
reddit.com › r/learnpython › how to install numpy
r/learnpython on Reddit: How to Install Numpy
June 10, 2025 -

A coworker sent me a Python file that uses numpy, so when I tried to run it, I got the error "No module named 'numpy'". So I looked up numpy, and it said in order to get that, I needed either conda or pip. so I looked up how to get conda, and it said I had to first download Anaconda. So I download Anaconda. I look in there and it would seem to me that both conda and numpy are already in there: Under Environments, both conda and numpy are listed as installed. But then I went back and tried to run the program again, and I got the same error. What else do I need to do to access numpy?

Also, idk if this matters, but I'm running Python on IDLE. Do I need to use a different IDE?

Top answer
1 of 11
45
open command prompt pip install numpy
2 of 11
4
Couple of options. Are you on windows? I'll just assume windows for now. You can run the script in the conda environment, base, created when you installed anaconda. Typically this is like, open the anaconda navigator. Select command prompt or powershell. Or, skip the navigator and just search your computer for "Anaconda prompt", which should open a terminal with base activated already. Then, you should see the (base) prefix left of the terminal interface. You can start from any sort of terminal, and activate the (base) environment activation script as well. What the activation script essentially does is it sets some temporary variables in your terminal to tell your computer which special folders to search for certain binaries (like python) / packages / libraries. The other method is if you have a global python install, you already have a global pip. This would've worked without anaconda. open cmd and run pip install numpy If you're in a locked-down coorporate environment, you may have some issues, but otherwise this is what you needed. You can also use the venv module to create virtual environments (similar to conda environments, but not 100% the same). They just let you keep different projects with different requirements, or different version requirements, isolated in their own 'virtual' environment. These typically install the dependencies in the same project folder, next to your code. whereas conda has a hidden folder somewhere with all your environments. I've been enjoying uv for managing different python virtual environments. It's another binary you install, but it lets you quickly create virtual environments, specify the python version, pin dependencies (like numpy in your case) and install them into your virtual environments. uv sort of keeps track of everything you use it, not quite like conda. If this is the only use of python you have, is running this one script, then you really can just run it all in a global python install and not worry about virtual environments. But it's good to know the what and why.
🌐
Stack Overflow
stackoverflow.com › questions › 46846171 › how-to-import-numpy-to-python-idle-2-7-on-windows
How to import numpy to python IDLE 2.7 on windows? - Stack Overflow
I have tried the following code on the python IDLE: import pip pip.main(["install","numpy"]) and the output I got is : Collecting numpy Could not fetch URL https://pypi.python.org/simple/n...
🌐
Pickl
pickl.ai › home › numpy in python idle
NumPy in Python idle Archives - Pickl.AI
Learn how to install NumPy in Python IDLE with easy steps and troubleshoot common installation issues.