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.

1
  • you can set the environment variable PYTHONPATH poiting to the folders were your modules are, if the error is an ImportError... Commented Sep 28, 2013 at 9:02

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

How would I install it using windows?
Google it. Here's a result from this very site: stackoverflow.com/questions/11200137/…
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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.