Hi everyone, I just downloaded and installed numpy, and I'd like to give it a try. But I can't seem to import it. When I try, this is what happens:

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> from numpy import *
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    from numpy import *
ImportError: No module named 'numpy'
>>> 

I downloaded and installed the 64-bit version; is that the problem? Or do I need to somehow set up the paths properly?

Strange, never had any problems with numpy and Python33.
I used the numpy-MKL-1.6.2.win32-py3.3.exe installer

Edited 3 Years Ago by vegaseat

Just updated numpy with
numpy-MKL-1.7.1.win32-py3.3.exe
and it works well.

Example used for test ...

''' np_primelist1.py
create a numpy array of prime numbers < limit
very fast algorithm
used Windows installer ...
numpy-MKL-1.7.1.win32-py3.3.exe
'''

import numpy as np

def np_primes1(limit):
    """returns a numpy array of primes, 2 <= p < limit"""
    # create a sieve of ones
    is_prime = np.ones(limit + 1, dtype=np.bool)
    for n in range(2, int(limit**0.5 + 1.5)):
        if is_prime[n]:
            is_prime[n*n::n] = 0
    return np.nonzero(is_prime)[0][2:]

print("first 10 primes:")
print(np_primes1(1000000)[:10])
print("last 5 primes (less than 1000000):")
print(np_primes1(1000000)[-5:])
print("convert first 10 primes to a list:")
print(list(np_primes1(1000000)[:10]))

''' result ...
first 10 primes:
[ 2  3  5  7 11 13 17 19 23 29]
last 5 primes (less than 1000000):
[999953 999959 999961 999979 999983]
convert first 10 primes to a list:
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
'''

Edited 3 Years Ago by vegaseat

This question has already been answered. Start a new discussion instead.