LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-14-2011, 04:46 PM   #1
CosmicThespian
LQ Newbie
 
Registered: Oct 2011
Location: Flagstaff, AZ
Distribution: Red Hat Enterprise 6.1
Posts: 8

Rep: Reputation: Disabled
Question 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!
 
Old 10-14-2011, 05:59 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,315

Rep: Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175
'liblapack.so' is provided by lapack-devel :

# yum provides */liblapack.so

# yum install lapack-devel
 
Old 10-14-2011, 06:12 PM   #3
CosmicThespian
LQ Newbie
 
Registered: Oct 2011
Location: Flagstaff, AZ
Distribution: Red Hat Enterprise 6.1
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
'liblapack.so' is provided by lapack-devel :

# yum provides */liblapack.so

# yum install lapack-devel
Thanks for the quick response! I tried this....and to make matters more complicated I don't have root access. Getting root access is, unfortunately, not really an option in my work environment. Is there a way to do with this without root?
 
Old 10-14-2011, 06:48 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,315

Rep: Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175
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>

..
 
1 members found this post helpful.
Old 10-14-2011, 07:16 PM   #5
CosmicThespian
LQ Newbie
 
Registered: Oct 2011
Location: Flagstaff, AZ
Distribution: Red Hat Enterprise 6.1
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
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>

..
Ugh....I should emphasize that I'm **very* new to all this. I'm trying to figure out what this means, but a lot of it is unclear.

"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.
 
Old 10-15-2011, 08:20 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,315

Rep: Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175
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:
And then, the export command
The export command is temporary. Will reset to /usr/lib:/lib etc.
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
export LD_LIBRARY_PATH=/home/<name>/usr/lib64:/usr/lib64:/lib64
<other command>

Last edited by knudfl; 10-15-2011 at 10:57 AM.
 
1 members found this post helpful.
Old 10-17-2011, 11:40 AM   #7
CosmicThespian
LQ Newbie
 
Registered: Oct 2011
Location: Flagstaff, AZ
Distribution: Red Hat Enterprise 6.1
Posts: 8

Original Poster
Rep: Reputation: Disabled
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!
 
Old 10-17-2011, 11:47 AM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
May be it would be easier to ask the administrator of that machine if he can install the dependencies of numpy for you.
 
1 members found this post helpful.
Old 10-17-2011, 12:12 PM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,315

Rep: Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175
Quote:
ImportError: libptf77blas.so: cannot open shared object file: No such file
Frustrating ? Use 3 seconds to find the package at http://rpm.pbone.net/
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

..

Last edited by knudfl; 10-17-2011 at 12:17 PM.
 
Old 10-17-2011, 05:20 PM   #10
CosmicThespian
LQ Newbie
 
Registered: Oct 2011
Location: Flagstaff, AZ
Distribution: Red Hat Enterprise 6.1
Posts: 8

Original Poster
Rep: Reputation: Disabled
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.
 
Old 10-17-2011, 06:43 PM   #11
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,020

Rep: Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455
Quote:
Just curious, is this a known "feature" of Red Hat? I'm surprised that it would ship with an incomplete python installation.
it did not

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 -
yum install lapack-devel
and about 30 sec. later it is installed

--- 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)

Last edited by John VV; 10-17-2011 at 06:46 PM.
 
Old 10-17-2011, 07:53 PM   #12
CosmicThespian
LQ Newbie
 
Registered: Oct 2011
Location: Flagstaff, AZ
Distribution: Red Hat Enterprise 6.1
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
it did not

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 .
Well, I don't have root access.....but it looks like this is all moot anyway. Apparently the files in /usr/local/ are all for Red Hat 5.1 and my machine is the first to have 6.1 installed. Or something to that effect, it's all a bit over my head. It needs to be dealt with on a sys admin level as far as I can tell so I'll just have to wait. Thank you, everyone, for your willingness to help.
 
Old 10-17-2011, 09:03 PM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,315

Rep: Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175
Quote:
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?
Yes, /home/<name>/usr/lib64/atlas must be added :
Code:
export LD_LIBRARY_PATH=/home/<name>/usr/lib64:/home/<name>/usr/lib64/atlas:/usr/lib64:/lib64 && <other-command>
 
Old 10-17-2011, 09:14 PM   #14
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,315

Rep: Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] python : NumPy : Array, Matrix Formatting cin_ Programming 2 08-05-2011 07:56 PM
Installing Python NUMPY on Godaddy server strimp099 Linux - Server 0 02-12-2011 07:03 AM
Installing python-numpy in the python2.5 installation of eee-pc zoopside Linux - Software 3 04-01-2009 07:42 PM
python error , import numpy ufmale Programming 2 08-25-2008 11:59 PM
Visual Python/Numpy uranologist Linux - Software 0 09-28-2003 10:08 PM


All times are GMT -5. The time now is 09:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration