Hello I am trying to get SciPy installed in my linux box. I got the last version via CVS, and have installed f2py2e, ATLAS, and Numeric. All seems OK, but when I import scipy from Python, I get "exceptions.ImportError: No module named clapack". My guess is that I should change scipy/scipy_distutils/site.cfg to tell scipy where to find the lapack library, but it doesn't work. Any idea? I need to get scipy work as soon as possible, so any help will be greately appreciated! Thank you. Giovanni PS: By the way, do you also know where to find another implementation of the gamma function for Python?
On Fri, 16 Aug 2002, Giovanni Montana wrote:
Hello
I am trying to get SciPy installed in my linux box. I got the last version via CVS, and have installed f2py2e, ATLAS, and Numeric. All seems OK, but when I import scipy from Python, I get "exceptions.ImportError: No module named clapack".
Just a guess: did you run python in scipy directory? If you did then change out of this directory, say, to $HOME and try again.
My guess is that I should change scipy/scipy_distutils/site.cfg to tell scipy where to find the lapack library, but it doesn't work. Any idea? I need to get scipy work as soon as possible, so any help will be greately appreciated!
What is the output of python scipy_distutils/system_info.py ? And what is the exact location of your atlas library? Finally, what is the output of ls -l /path/to/your/atlas/lib{lapack,f77blas,cblas,atlas}.a ? Pearu
Dear Pearu, thanks for your reply.
Just a guess: did you run python in scipy directory?
No I had tried running it from other places too. The strange thing (to me) is that, even if Python returns an "exceptions.ImportError: No module named clapack", scipy still *seems* to be working just fine (or at least I can use the functions I needed most so far, or even play with the nice wxPython-based plotting tutorial).
What is the output of
python scipy_distutils/system_info.py
not really good-looking I guess: atlas_info: NOT AVAILABLE blas_info: FOUND: libraries = ['blas'] library_dirs = ['/usr/lib'] blas_src_info: NOT AVAILABLE fftw_info: NOT AVAILABLE lapack_info: FOUND: libraries = ['lapack'] library_dirs = ['/usr/lib'] lapack_src_info: NOT AVAILABLE x11_info: FOUND: libraries = ['X11'] library_dirs = ['/usr/X11R6/lib'] include_dirs = ['/usr/X11R6/include']
? And what is the exact location of your atlas library?
it's in $HOME/ATLAS/lib/Linux_P4SSE2_2/
ls -l /path/to/your/atlas/lib{lapack,f77blas,cblas,atlas}.a
-rw-r--r-- 1 root root 7436968 Aug 16 03:29 libatlas.a -rw-r--r-- 1 root root 313244 Aug 16 03:23 libcblas.a -rw-r--r-- 1 root root 356926 Aug 16 03:29 libf77blas.a -rw-r--r-- 1 root root 5335460 Aug 16 13:56 liblapack.a By the way, am I supposed to find a clapack.so somewhere in the scipy/build/lib.linux-i686-2.2/ folder? Thanks. Giovanni -- Giovanni Montana Department of Human Genetics University of Chicago, 920 E. 58th Street - CLSC 507 Chicago, IL 60637, USA Phone: (773) 834-5243
On Sat, 17 Aug 2002, Giovanni Montana wrote:
The strange thing (to me) is that, even if Python returns an "exceptions.ImportError: No module named clapack", scipy still *seems* to be working just fine (or at least I can use the functions I needed most so far, or even play with the nice wxPython-based plotting tutorial).
It's a feature needed when one decides not to use atlas. Say, when using other optimized blas/lapack libraries.
? And what is the exact location of your atlas library?
it's in $HOME/ATLAS/lib/Linux_P4SSE2_2/
So, try ATLAS=$HOME/ATLAS/lib/Linux_P4SSE2_2/ python system_info.py to see if scipy_distutils is able to find your atlas. Then proceed with cd scipy rm -rf build ATLAS=$HOME/ATLAS/lib/Linux_P4SSE2_2/ python setup.py install Btw, you mentioned that you tired to edit site.cfg. It should have been worked. Therefore I wonder what went wrong with site.cfg? Basically, the following steps are necessary: 1) cd scipy/scipy_distutils cp sample_site.cfg site.cfg 2) Edit site.cfg. In your case there must be the following fragment [atlas] library_dirs = $HOME/ATLAS/lib/Linux_P4SSE2_2/ [Hmm, I am not sure if $HOME will be expanded.] 3) Check that your atlas is found with python system_info.py 4) Proceed with cd scipy python setup.py install
ls -l /path/to/your/atlas/lib{lapack,f77blas,cblas,atlas}.a
-rw-r--r-- 1 root root 7436968 Aug 16 03:29 libatlas.a -rw-r--r-- 1 root root 313244 Aug 16 03:23 libcblas.a -rw-r--r-- 1 root root 356926 Aug 16 03:29 libf77blas.a -rw-r--r-- 1 root root 5335460 Aug 16 13:56 liblapack.a
By the way, am I supposed to find a clapack.so somewhere in the scipy/build/lib.linux-i686-2.2/ folder?
No. clapack is build only if atlas is available. Pearu
So, try
ATLAS=$HOME/ATLAS/lib/Linux_P4SSE2_2/ python system_info.py
to see if scipy_distutils is able to find your atlas.
No, even changing that env. variable doesn't make scipy_distutils see where ATLAS actually is! Also, I doublechecked again the site.cfg file I had modified, and it looks OK. I can't figure out what I am missing ... Giovanni -- Giovanni Montana Department of Human Genetics University of Chicago, 920 E. 58th Street - CLSC 507 Chicago, IL 60637, USA Phone: (773) 834-5243
On Sat, 17 Aug 2002, Giovanni Montana wrote:
So, try
ATLAS=$HOME/ATLAS/lib/Linux_P4SSE2_2/ python system_info.py
to see if scipy_distutils is able to find your atlas.
No, even changing that env. variable doesn't make scipy_distutils see where ATLAS actually is! Also, I doublechecked again the site.cfg file I had modified, and it looks OK.
I can't figure out what I am missing ...
Can you send the full output of ATLAS=$HOME/ATLAS/lib/Linux_P4SSE2_2/ python setup.py build ? Make sure that you also include stderr messages. Pearu
Can you send the full output of
ATLAS=$HOME/ATLAS/lib/Linux_P4SSE2_2/ python setup.py build
? Make sure that you also include stderr messages.
yes, this is what I get now: scipy_distutils 0.1.13-alpha-93 running build running build_py not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/__init__.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/auto_test.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/core.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/dist.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/extension.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/line_endings.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/logging.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/mingw32_support.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/misc_util.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/setup_scipy_distutils.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/system_info.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/__version__.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/command/__init__.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/command/build.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/command/build_clib.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/command/build_ext.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/command/build_flib.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/command/build_py.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/command/cpuinfo.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/command/install.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/command/install_data.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/command/install_headers.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/command/run_f2py.py (output up-to-date) not copying /usr/lib/python2.2/site-packages/scipy/scipy_distutils/command/sdist.py (output up-to-date) Ops, I also wonder whether all permissions are OK, since I've been installing everything as root ... Giovanni
On Sat, 17 Aug 2002, Giovanni Montana wrote:
Can you send the full output of
ATLAS=$HOME/ATLAS/lib/Linux_P4SSE2_2/ python setup.py build
? Make sure that you also include stderr messages.
yes, this is what I get now:
scipy_distutils 0.1.13-alpha-93
<snip> You are running this command inside scipy_distutils. You should run it in the scipy directory. To be sure, remove the build directory before executing ATLAS=$HOME/ATLAS/lib/Linux_P4SSE2_2/ python setup.py build Pearu
Pearu, attached is the complete log of the command ATLAS=$HOME/ATLAS/lib/Linux_P4SSE2_2/ python setup.py build executed in the scipy directory after removing the build directory. Hope you can understand what the problem is from there. Thank you indeed. Cheers, Giovanni
On Sat, 17 Aug 2002, Giovanni Montana wrote:
Pearu,
attached is the complete log of the command
ATLAS=$HOME/ATLAS/lib/Linux_P4SSE2_2/ python setup.py build
executed in the scipy directory after removing the build directory.
Hope you can understand what the problem is from there. Thank you indeed.
Have you tried to expand $HOME? May be it is empty? Did you install ATLAS as root but now working as an user so that $HOME is different? You can also look to system_info.py file, in particular, the definition of atlas_info class and put some print commands inside the calc_info method to see at what point this method is failing. You can print out variables like lib_dirs, lapack_libs, atlas_libs, etc. HTH, Pearu
You can also look to system_info.py file, in particular, the definition of atlas_info class and put some print commands inside the calc_info method to see at what point this method is failing. You can print out variables like lib_dirs, lapack_libs, atlas_libs, etc.
Yes, I've played a bit with those variables, ect. and managed to let scipy find the ATLAS folder, but NOT the souces. This is the outout when running system_info.py (modified to display where it's looking for sources): atlas_info: FOUND: libraries = ['lapack', 'f77blas', 'cblas', 'atlas'] library_dirs = ['/usr/lib', '/home/strbr/ATLAS/lib/Linux_P4SSE2_2'] blas_info: FOUND: libraries = ['blas'] library_dirs = ['/usr/lib'] blas_src_info: ['/usr/local/src', '/home/strbr/ATLAS/src/lapack', '/home/strbr/ATLAS/src/blas'] NOT AVAILABLE fftw_info: NOT AVAILABLE lapack_info: FOUND: libraries = ['lapack'] library_dirs = ['/usr/lib'] lapack_src_info: ['/usr/local/src', '/home/strbr/ATLAS/src/lapack', '/home/strbr/ATLAS/src/blas'] NOT AVAILABLE x11_info: FOUND: libraries = ['X11'] library_dirs = ['/usr/X11R6/lib'] include_dirs = ['/usr/X11R6/include'] I wondering whether you could tell me where to look for these sources exactly. Also, is the clapack library supposed to be in the same folder with the other ATLAS libraries? I still get the same error message when loading the scipy module, so I guess I do need to let scipy find the sources first? Thanks Giovanni
On Mon, 19 Aug 2002, Giovanni Montana wrote:
You can also look to system_info.py file, in particular, the definition of atlas_info class and put some print commands inside the calc_info method to see at what point this method is failing. You can print out variables like lib_dirs, lapack_libs, atlas_libs, etc.
Yes, I've played a bit with those variables, ect. and managed to let scipy find the ATLAS folder, but NOT the souces.
If you have ATLAS, then you don't need any sources.
This is the outout when running system_info.py (modified to display where it's looking for sources):
atlas_info: FOUND: libraries = ['lapack', 'f77blas', 'cblas', 'atlas'] library_dirs = ['/usr/lib', '/home/strbr/ATLAS/lib/Linux_P4SSE2_2']
Looks almost good. Except because /usr/lib appears first, scipy will be linked against /usr/lib/liblapack.a and that will cause the import errors that you get, I believe. Try to get rid of /usr/lib part (I'll try to fix it also in scipy_distutils so that it automatically uses lapack only from ATLAS lib).
I wondering whether you could tell me where to look for these sources exactly.
No need for sources.
Also, is the clapack library supposed to be in the same folder with the other ATLAS libraries?
There is no clapack library in ATLAS. The only one is the clapack shared module in scipy.linalg that scipy should build whenever ATLAS is available.
I still get the same error message when loading the scipy module, so I guess I do need to let scipy find the sources first?
See above the atlas_info part. Also when building, pay attention that the wrong lapack library (in /usr/lib) will not be used when linking clapack.so HTH, Pearu
Looks almost good. Except because /usr/lib appears first, scipy will be linked against /usr/lib/liblapack.a and that will cause the import errors that you get, I believe. Try to get rid of /usr/lib part (I'll try to fix it also in scipy_distutils so that it automatically uses lapack only from ATLAS lib).
yes, I changed that too so as to use the right directories only: atlas_info: FOUND: libraries = ['lapack', 'f77blas', 'cblas', 'atlas'] library_dirs = ['/home/strbr/ATLAS/lib/Linux_P4SSE2_2'] blas_info: FOUND: libraries = ['blas'] library_dirs = ['/usr/lib'] lapack_info: FOUND: libraries = ['lapack'] library_dirs = ['/home/strbr/ATLAS/lib/Linux_P4SSE2_2'] However, I still get the error message.
See above the atlas_info part. Also when building, pay attention that the wrong lapack library (in /usr/lib) will not be used when linking clapack.so
clapack.so has been built this time (in build/.../scipy/linalg/), but still I coudn't import it. So I guess thw wrong path was used when linking it? I tried to run setup_linalg.py and I get: atlas_info: NOT AVAILABLE setup_linalg.py:39: UserWarning: Atlas (http://math-atlas.sourceforge.net/) libraries not found. Directories to search for the libraries can be specified in the scipy_distutils/site.cfg file (section [atlas]) or by setting the ATLAS environment variable. but both things (site.cfg and ATLAS var) are correct... Giovanni
On Tue, 20 Aug 2002, Giovanni Montana wrote:
See above the atlas_info part. Also when building, pay attention that the wrong lapack library (in /usr/lib) will not be used when linking clapack.so
clapack.so has been built this time (in build/.../scipy/linalg/), but still I coudn't import it.
Try to import directly. I mean cd build/lib.../scipy/linalg and then from python do import clapack. What exactly happens? You can use programs like ldd and nm to find out what symbols are missing or available in libraries.
So I guess thw wrong path was used when linking it?
You can see it when building it. Look for 'gcc -shared ...' command lines.
I tried to run setup_linalg.py and I get:
atlas_info: NOT AVAILABLE
setup_linalg.py:39: UserWarning: Atlas (http://math-atlas.sourceforge.net/) libraries not found. Directories to search for the libraries can be specified in the scipy_distutils/site.cfg file (section [atlas]) or by setting the ATLAS environment variable.
but both things (site.cfg and ATLAS var) are correct...
How can python scipy_distutils/system_info.py find ATLAS and when in linalg, ATLAS is not detected? If you made changes (then what?) to system_info.py then I suspect that while you execute setup_linalg.py, then other system_info.py is used from the installed scipy. Make the following link to linalg directory cd linalg && ln -s ../scipy_distutils . and try again setup_linalg.py. Pearu
So, try
ATLAS=$HOME/ATLAS/lib/Linux_P4SSE2_2/ python system_info.py
to see if scipy_distutils is able to find your atlas.
in case I can't make ATLAS work for the time being, is there a way to avoid displaying that error message? Thanks, Giovanni
participants (3)
-
Giovanni Montana
-
Pearu
-
Pearu Peterson