Numpy is not working

Hi Mike, I’m happy you were able to resolve the problem. I just want to give a quick overview to make sure you understand what was going on, and can talk about it with proper terms in the future (in case a similar problem comes up, or just for your own benefit). Maybe it will also help explain how the others ITT thought about the problem, and why they wanted to know what they did.

What you have been doing so far has nothing to do with the PYTHONPATH environment variable, and what you are installing are not “applications”.

From the screenshots, I inferred the following things:

  1. You are running Windows.
  2. You (or someone else) installed Python 3.12 from the Microsoft Store, and it’s installed “for all users”.
  3. The account you are using on the computer does not have admin rights.
  4. You successfully installed the NumPy third-party library (using a user-level installation - Pip chose this automatically because it did not have admin rights, which it needs if it wants to install “for all users”) for that Python.
  5. The Numpy installation would have worked as is from the command line. In the same command window where you tried pip install numpy and got an “already installed” message, you could have tried python to start a command-line Python interpreter, and then import numpy from there.
  6. However, you use PyCharm to edit your code files. When you use PyCharm, it creates a virtual environment for your project. The purpose of this is to keep the project’s requirements separate, so that you can let your main Python installation stay “clean” while making sure your project has what it needs to run (and so you can see, from that virtual environment’s setup, what the code needs to run - which helps when you later want to share the code).

To make the code that you edit in PyCharm be able to use Numpy, you should install Numpy into the virtual environment that PyCharm created for you. To do this, you should use the functionality built in to PyCharm, like what Jeff showed you. PyCharm created the virtual environment, and knows everything relevant about that virtual environment, so it’s in a sense “responsible” for maintaining it. Of course, nothing prevents you from tracking down where that virtual environment is, and manually installing into it (and this could even be good practice for understanding how virtual environments work). But it partly defeats the purpose of using PyCharm.

When I teach beginners, I advise them not to use PyCharm or any other IDE to start. While many people find these tools useful (I don’t personally use them even after ~20 years of experience in Python), I have found that getting good use out of them requires understanding some basic concepts first - not just about Python, but about programming in general, and about how software developers organize their projects (and why). These tools, in my experience, tend to confuse beginners more than they help - by trying to do behind-the-scenes work that they don’t explain up front (such as the virtual environment that caused problems for you here), and by making suggestions about the code that beginners either won’t properly understand or will incorrectly interpret as errors.

Thanks Karl:

I have already stopped using PyCharm and have gone back to the beginning of the w3schools tutorial using only the DOS prompt.

I am using Windows Notepad for all my coding and this seems give a better understanding of where things are:

I do have one weird thing happening. In windows, if I want to invoke python such as:

  • py -m venv myworld
    it doesn’t work, Even though I am in Windows, I have to use
  • python -m venv myworld

Anyway, I find Python has a very steep learning curve with a great deal of setup work. I hope it is all worth it.

Thanks for all your help.

Mike

Exactly how do you try it, and exactly what happens when you try it?

Hi Karl:

I have fixed it.

I had several copies of Python312 and Django installed. I uninstalled them all and installed just one copy of each. Then I set up PYTHONPATH in the Windows Environment for the single installations.

Now it works fine.

Thank you for asking.

Mike

You should be able to manage without defining PYTHONPATH in the Windows environment. Try without. Less is more.

Obviously the directory where python.exe can be found has to be one of those on the PATH environment variable, but once it is running, it will normally find everything else for itself. This includes things pip installed, if it was running under the same python.exe.

PYTHONPATH is for when you need it to find modules in a non-standard place.

Jeff:

Thank you for this.

Right now the languages are working but Django is not working,

I have thrown in the towel. I have carefully entered the code from 2 different tutorials and sometimes it will find 900 errors. The debugging messages make no sense and are not something I could solve in my lifetime.

Time to move on.

Mike

Hi Mike

I am new to here tried all things i have installed all packages below path
C:\Users\AVISHA\AppData\Local\Programs\Python\Python313\Lib\site-packages
While importing into IDEL getting below error
Python 3.13.4 (tags/v3.13.4:8a526ec, Jun 3 2025, 17:46:04) [MSC v.1943 64 bit (AMD64)] on win32
Enter “help” below or click “Help” above for more information.
import os;
os.getcwd()
‘C:\Users\AVISHA\AppData\Local\Programs\Python\Python313’
import NumPy
Traceback (most recent call last):
File “<pyshell#2>”, line 1, in
import NumPy
ModuleNotFoundError: No module named ‘NumPy’
Can you please help me

Please follow NumPy quickstart — NumPy v2.2 Manual. If you’re having issues, open a new thread rather than resurrecting an old one, which will notify users who haven’t opted into discussing this with you.