Python Forum
How to run numpy - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: How to run numpy (/thread-10796.html)



How to run numpy - Viesturs - Jun-06-2018

I created a file nmpy.py following exactly given the code in the numpy tutorial -
https://docs.scipy.org/doc/numpy/user/quickstart.html

The contents of nmpy.py are the following:

import numpy as np
a = np.array([2,3,4])
When I run the script

python nmpy.py

I get the following problem:

Error:
Traceback (most recent call last): File "nmpy.py", line 1, in <module> import numpy as np File "/home/v/numpy.py", line 2, in <module> AttributeError: 'module' object has no attribute 'array'
What is wrong?


RE: How to run numpy - scidam - Jun-07-2018

What is your current working directory? Does working directory contain a file named numpy.py? If so, remove it from your current directory.


RE: How to run numpy - Viesturs - Jun-07-2018

That seemed to be the issue