analitics

Pages

Showing posts with label Numeric. Show all posts
Showing posts with label Numeric. Show all posts

Thursday, May 7, 2015

The numpy - install over python 3.4 version.

The last version 1.9.2 of python module can solve instalation over python from sourceforge.net -projects.
This link from Numerical Python module come with exe file over python versions: 3.4 , 3.3 and 2.7.
I test the 3.4 version - 32 bits but I got this great error:
>>> import numpy
Traceback (most recent call last):
File "", line 1, in 
File "C:\Python34\lib\site-packages\numpy\__init__.py", line 170, in 
from . import add_newdocs
File "C:\Python34\lib\site-packages\numpy\add_newdocs.py", line 13, in 
from numpy.lib import add_newdoc
File "C:\Python34\lib\site-packages\numpy\lib\__init__.py", line 8, in 
from .type_check import *
File "C:\Python34\lib\site-packages\numpy\lib\type_check.py", line 11, in 
import numpy.core.numeric as _nx
File "C:\Python34\lib\site-packages\numpy\core\__init__.py", line 6, in 
from . import multiarray
ImportError: DLL load failed: %1 is not a valid Win32 application.
How to fix this:
Also the pip3.4 don't want to install the numpy python module just if you use this link.
You can do this with :
C:\Python34\Scripts>pip3.4.exe install --upgrade wheel
Requirement already up-to-date: wheel in c:\python34\lib\site-packages
C:\Python34\Scripts>pip3.4.exe install "C:\Users\...\Downloads\numpy-1.9.2+m
kl-cp34-none-win_amd64.whl"
After that you can import the numpy module 

Sunday, August 7, 2011

Python errors: numpy vs. Numeric

Today I decided to clarify some of the error that we met and I found a solution.

I created a new series called: Python errors

The first error occurs in trying to run scripts that require Numeric module.

You can run python 2.7 with numpy. But the Numeric module is not available in python 2.7 .

Such a script will try to import module:

import Numeric

and the next step will be something like:


s = Numeric.zeros((N,N),Numeric.Float32)
...
s = Numeric.zeros((N,N),Numeric.Int32)

The first error is :

    import Numeric
ImportError: No module named Numeric

Now , if you change from Numeric in numpy then you got this error:

    ... = numpy.zeros( (N,N),numpy.Float32 )
AttributeError: 'module' object has no attribute 'Float32'
To working well, just use this :
numpy.zeros( (N,N),float)
numpy.zeros( (N,N), int)

Actually, should be replaced :

numpy.Float32

with

float

The same applies for Int32 .