I've been having troubles using numpy in python 2.7. I get the following error message:
import numpy
array = numpy.array([1,2,3])
print array
>>>array = numpy.array([1,2,3])
>>>AttributeError: 'module' object has no attribute 'array'
I've installed dozens of python packages in the past using the "pip install" command and never had any issues.
When installing numpy I went to my windows cmd and typed:
pip install numpy
>>>Installing collected packages: numpy
>>>Successfully installed numpy-1.15.4
To double check that it was installed successful and in the correct python folder I then typed the command a second time:
pip install numpy
>>>Requirement already satisfied: numpy in c:\python27\lib\site-packages (1.15.4)
This proved to me that numpy was installed in the correct python 2.7 path (and not in python 3.7 which I also have installed).
However, Im still getting the error message "module object has no attribute" whenever I try using numpy in python 2.7.
What am I doing wrong here?
Thanks