Problem with the numpy module

Please start by reading the pinned thread in order to understand how to format the code and diagnostic messages clearly. (Error output from Python is usually designed to be viewed in a terminal window, so it should be formatted the same way as the code). It will also be helpful to write some prose in between in order to walk us through what you are actually doing, what you expect to happen when you do that, what happens instead, and why you are confused by that result.

If you think the problem is with someone else’s code, or with the installation of that code, you should start by trying to create as simple of an example as possible that reproduces the problem - even if that means you only import something and see what happens. If you’re running into a problem with third-party code that you installed, it’s also helpful to explain how you installed the code, what version of the library you have, what version of Python is being used, or anything else that seems suspicious.

It looks like you are using PyCharm to run the code? It would be better to explain this up front; and if you used PyCharm to set up Numpy etc., explain what steps you took here.


All of that said, from what I can read and make out from what you have so far, this is my best guess: you have a file called numbers.py in your own code, which conflicts with the standard library (which Numpy is trying to use here). Please read this for reference:

3 Likes