Tyson
Tyson

Reputation: 59

Importing modules with python

I'm working with python 2.7 (32-bit) on Windows Vista. I downloaded some libraries including numpy, scipy, and pygame. When I try to import these modules the output says

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import numpy
ImportError: No module named numpy

I can find these modules in my python folders but for some reason it doesn't want to recognize it or some thing. (I made sure the file were compatible before downloading.)

Upvotes: 0

Views: 12456

Answers (3)

EgMusic
EgMusic

Reputation: 134

To properly install this module:

  1. In the Windows search bar (START MENU) type Command Prompt
  2. Right-click on the Command Prompt icon (DO NOT go to cmd)
  3. Click Run as Administrator
  4. in the COMMAND PROMPT (DO NOT open cmd) type:

pip install numpy

This will install that module.

What it will look like

NOTE: If you are NOT in admin mode, you will get a message saying a fatal error has been raised.

Upvotes: 0

6c1
6c1

Reputation: 402

Each package should contain a setup.py file. Run this with the command python setup.py install

For more information:

http://www.scipy.org/Installing_SciPy/Windows http://pygame.org/install.html

Upvotes: 4

Louis
Louis

Reputation: 2890

"Everytime I run the command "python setup.py install" in the python shell it says SyntaxError: invalid syntax "

Please create a folder where you unzip the "numpy.zip" file, say the folder name is "c:\numpy"

Open a MS-DOS terminal (as described here : http://en.wikipedia.org/wiki/Command-line_interface), and type :

cd c:\numpy
python setup.py config
python setup.py install

This will set up the needed files in the correct folders for your python. Enjoy !

Upvotes: 1

Related Questions