2

I have downloaded the numpy zip file, and have unzipped it in the folder where my project is located. I used the code

from numpy import *

but when I try to use the functions, such as the matrix function, from numpy the matrix class apparently doesn't exist. I am very new to python, so maybe an explanation about how to include files in python is also due.

IsaacZinda
  • 31
  • 1
  • 9

2 Answers2

2

You can't just "unzip" Numpy and start using it--it needs to be built and installed. What platform are you on? If it's a Linux, you should use your distro's package manager to install numpy. If you can't do that, you might use pip install numpy to install it, or if you need to install it locally within your user account only, pip install --user numpy.

The gist is that Numpy is largely written in C, and needs to be compiled on the target platform (or a binary distribution downloaded, e.g. via the OS package manager). You can't just download and use it straight away.

John Zwinck
  • 239,568
  • 38
  • 324
  • 436
0

Sourceforge.net is a good site if you're using python versions 2.7, 3.3, 3.4, 3.7 Get the zip file, if direct file is not available. Before downloading, check the versions of python compatible with your version of python.