-1

I am trying to input a matix using numpy and I get the following error:

Traceback (most recent call last):
  File "phase1.py", line 1, in <module>
    import numpy as np 
  File "/home/rockstar/phase1.py", line 2, in <module>
    a= np.array([1,2,3])
AttributeError: 'module' object has no attribute 'array'

I am not sure why this error is there. Could anyone help?

McGrady
  • 10,869
  • 13
  • 47
  • 69
user4532954
  • 33
  • 2
  • 11
  • 1
    Possible duplicate of [Using numpy 'module' object has no attribute 'array'](http://stackoverflow.com/questions/36530726/using-numpy-module-object-has-no-attribute-array) – McGrady Mar 23 '17 at 12:28

1 Answers1

3

You probably have a file called numpy.py in the same folder that shadows the real numpy module. Rename your .py file and delete its .pyc file.

timgeb
  • 76,762
  • 20
  • 123
  • 145