New user: python numpy import error
New to Linux, new to python...have no idea what I'm doing. Now that that's out of the way....
I have a computer at work with a new installation of Red Hat Enterprise 6.1. I tried starting python - that works (ver 2.5.4). I then tried typing 'import numpy' and received this error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.5/site-packages/numpy/__init__.py", line 130, in <module> import add_newdocs File "/usr/local/lib/python2.5/site-packages/numpy/add_newdocs.py", line 9, in <module> from lib import add_newdoc File "/usr/local/lib/python2.5/site-packages/numpy/lib/__init__.py", line 13, in <module> from polynomial import * File "/usr/local/lib/python2.5/site-packages/numpy/lib/polynomial.py", line 18, in <module> from numpy.linalg import eigvals, lstsq File "/usr/local/lib/python2.5/site-packages/numpy/linalg/__init__.py", line 47, in <module> from linalg import * File "/usr/local/lib/python2.5/site-packages/numpy/linalg/linalg.py", line 22, in <module> from numpy.linalg import lapack_lite ImportError: liblapack.so: cannot open shared object file: No such file or directory A google search for the last line ("ImportError....") turned up a few things but it was all well over my head. I haven't a clue what this means (except that 'liblapack.so' appears to be missing) or what to do about it. Help! |
'liblapack.so' is provided by lapack-devel :
# yum provides */liblapack.so # yum install lapack-devel |
Quote:
|
Well, you can unpack the rpm's and have e.g. /home/<name>/usr/lib/
( Or /home/<name>/usr/lib64/, if it's a 64bits OS.) 32bits: lapack-3.2.1-4.el6.i686.rpm, lapack-devel-3.2.1-4.el6.i686.rpm http://ftp.scientificlinux.org/linux...6/os/Packages/ 64bits: lapack-3.2.1-4.el6.x86_64.rpm, lapack-devel-3.2.1-4.el6.x86_64.rpm http://ftp.scientificlinux.org/linux...4/os/Packages/ Use with e.g. export LD_LIBRARY_PATH=/home/<name>/usr/lib:/usr/lib:/lib && <other-command> .. |
Quote:
"unpack the rpm's": I found those files and downloaded them (the 64 bit versions). I'm not sure what 'unpack the rpm's' means. I found an 'rpm' command...is that what I should be using? I don't see a way to get it to install in /home/<name>/usr/lib/. And then, the export command. I add that to my .bashrc file? What's <other-command> referring to? I'm sorry if these are very basic questions...I've never tried to do anything like this before and I'm finding the available documentation incredibly obtuse. |
This will unpack to : usr/lib64/*** in the current directory :
1) rpm2cpio lapack-3.2.1-4.el6.x86_64.rpm | cpio -idmv 2) rpm2cpio lapack-devel-3.2.1-4.el6.x86_64.rpm | cpio -idmv Quote:
when you exit the terminal. The LD_LIBRARY_PATH can be added to the bashrc. May work. Or you can use a "start script", like : Code:
#!/bin/sh |
Thanks again for the reply. That was helpful. That seemed to fix the error I describe above, but now I get this error when trying to import numpy:
>>> import numpy Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.5/site-packages/numpy/__init__.py", line 130, in <module> import add_newdocs File "/usr/local/lib/python2.5/site-packages/numpy/add_newdocs.py", line 9, in <module> from lib import add_newdoc File "/usr/local/lib/python2.5/site-packages/numpy/lib/__init__.py", line 13, in <module> from polynomial import * File "/usr/local/lib/python2.5/site-packages/numpy/lib/polynomial.py", line 18, in <module> from numpy.linalg import eigvals, lstsq File "/usr/local/lib/python2.5/site-packages/numpy/linalg/__init__.py", line 47, in <module> from linalg import * File "/usr/local/lib/python2.5/site-packages/numpy/linalg/linalg.py", line 22, in <module> from numpy.linalg import lapack_lite ImportError: libptf77blas.so: cannot open shared object file: No such file or directory Looks like another missing file. How frustrating! |
May be it would be easier to ask the administrator of that machine if he can install the dependencies of numpy for you.
|
Quote:
Search >>> Advanced Search , and tick CentOS5 Scientific 5, Redhat EL5. ( Search for "libptf77blas.so".) Also : These yum commands can be used as unprivileged user : yum search <package name> ( Or part of package name.) And : yum provides */libptf77blas.so → → atlas-devel Download atlas-devel, atlas from the EPEL repo (You'd know that repo name from the rpmpbone search) : ( http://download.fedora.redhat.com/pu...6_64/repoview/ ) http://download.fedora.redhat.com/pub/epel/5/x86_64/ > atlas-devel-3.8.3-1.el5.x86_64.rpm, atlas-3.8.3-1.el5.x86_64.rpm .. |
Well, I downloaded those two files (atlas-devel-3.8.3-1.el5.x86_64.rpm and atlas-3.8.3-1.el5.x86_64.rpm) and used rpm2cpio just as I did with the previous two .rpm files. I'm getting the same error message when I try to import numpy. Does another path need to be set somewhere so python knows where to find libptf77blas.so?
Just curious, is this a known "feature" of Red Hat? I'm surprised that it would ship with an incomplete python installation. |
Quote:
those files will be in the RHN repo the one that YOU CAN NOT USE without root access, and a paid for support license, to install software and receive updates . Code:
su - --- WARNING ---- (atlas-devel-3.8.3-1.el5.x86_64.rpm and atlas-3.8.3-1.el5.x86_64.rpm) those are for RHEL 5 and NOT for RHL6.1 . those rpms will KILL a rhel6 install REPLACE THEM with the RHEL 6 rpm's ( el6) |
Quote:
|
Quote:
Code:
export LD_LIBRARY_PATH=/home/<name>/usr/lib64:/home/<name>/usr/lib64/atlas:/usr/lib64:/lib64 && <other-command> |
Sorry for the EL5 links. ( The EL6 packages may not be different ? )
But anyway, the EL 6 packages are here : http://ftp.scientificlinux.org/linux...4/os/Packages/ > atlas-devel-3.8.3-12.4.el6.x86_64.rpm, atlas-3.8.3-12.4.el6.x86_64.rpm |
All times are GMT -5. The time now is 02:39 AM. |