Problem with the numpy module

I’m Kent Anderson, learning python for the first time.
I was attempting to practice a sample with numpy, and ran into these problems.

import numpy as np

A = np.array([[1, 2, 5], [2, -3, 2], [3, 1, -1]])
B = np.array([[-17], [-16], [3]])

P = np.linalg.solve(A, B)

C:\Users\kland\PycharmProjects\pythonProject\venv\Scripts\python.exe C:\Users\kland\PycharmProjects\pythonProject\
Traceback (most recent call last):
File “C:\Users\kland\PycharmProjects\pythonProject\”, line 4, in
import numpy as np
File “C:\Users\kland\PycharmProjects\pythonProject\venv\lib\site-packages\”, line 144, in
from numpy.config import show as show_config
File “C:\Users\kland\PycharmProjects\pythonProject\venv\lib\site-packages\”, line 4, in
from numpy.core.multiarray_umath import (
File "C:\Users\kland\PycharmProjects\pythonProject\venv\lib\site-packages\numpy\core_init
.py", line 72, in
from . import numerictypes as nt
File “C:\Users\kland\PycharmProjects\pythonProject\venv\lib\site-packages\numpy\core\”, line 595, in
File “C:\Users\kland\PycharmProjects\pythonProject\venv\lib\site-packages\numpy\core\”, line 590, in _register_types
AttributeError: module ‘numbers’ has no attribute ‘Integral’

Process finished with exit code 1

Looks like the module that I was trying to import has the bugs rather than my main module. Can anyone figure what’s going on here?

I get this result:

 [ 2.]

and no error.


An online search suggests that it’s caused by a filename conflict.

Is one of your files called It might be finding that one instead of numpy’s

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 in your own code, which conflicts with the standard library (which Numpy is trying to use here). Please read this for reference:


Yes, I wrote a practice file and named it numbers a while back. Thank you for that