Tuesday, 15 September 2015

PYTHON: Error in recognising numpy module -


I am using Python 3.4.0 . I think the numpy module should work because it is one of the newer versions of Python, however, whatever I do with the numpy , the result is a syntax error . See about this code here:

  import numpy list1 = [1,3,2,6,9] list2 = numpy.mean (list1) print (list2)  

And then I get:

  Traceback (last call final): File "/ home / yichen / desktop / python / numpy test.py" Line 1, & lt; In module & gt; Import Numpy importError: There is no module named 'numpy'  

Is this a problem in my computer or bus?

It looks like numpy is not installed on your system. Assume that you have the pip script installed with Python, you can do the following command to install it:

  pip install numpy  

or

  install pip3.4 nmpy  

Or, depending on your distribution, this python-numpy Can come in the form of a package called with your package manager.


No comments:

Post a Comment