PDA

View Full Version : Strange import failure of scipy.linalg on etch


dfranz
02-10-2007, 10:33 PM
I have a strange problem getting scipy.linalg to import under
python 2.4, the default version for Etch. The problem is that
it works on two out of three machines on which I have tried
it. Thus it seems clear that there is nothing wrong with
scipy, numpy, and python from Etch. All machines have
been upgraded to the latest updates from Debian. One
machine runs a Pentium M, and the others are AMD 64 bit
CPU's.

I have removed all software that I thought might cause a
problem, but to no avail. I have also reinstalled the key
packages--still no go. Clearly there is something wrong with
the failing machine, and unfortunately it is my current
desktop workhorse machine:(

The problem is not just with linalg but with all of the
subsiduary modules: linalg, linsolve, integrate, etc. They
all yield much the same final problem: cannot import name
ccompiler. However, ccompiler.py clearly exists in the
directory referenced.

Here is the traceback from the attempt.:

ddf@ax2:~$ python
Python 2.4.4 (#2, Jan 13 2007, 17:50:26)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy.linalg
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/scipy/linalg/__init__.py", line 32, in ?
test = ScipyTest().test
File "/usr/lib/python2.4/site-packages/numpy/testing/numpytest.py", line 285, in __init__
from numpy.distutils.misc_util import get_frame
File "/usr/lib/python2.4/site-packages/numpy/distutils/__init__.py", line 5, in ?
import ccompiler
File "/usr/lib/python2.4/site-packages/numpy/distutils/ccompiler.py", line 6, in ?
from distutils.ccompiler import *
File "/usr/lib/python2.4/site-packages/numpy/distutils/__init__.py", line 5, in ?
import ccompiler
File "/usr/lib/python2.4/site-packages/numpy/distutils/ccompiler.py", line 7, in ?
from distutils import ccompiler
ImportError: cannot import name ccompiler


I need some clues of what might be wrong with my desktop
machine, the only one where I get this failure. A search of
the web has found no clues yet:(

Thanks

fos
02-10-2007, 10:50 PM
Check the permissions on compiler.py and the other related files.

If they are present in the referenced directory it should work.

fos....

PS. Welcome to the forum. I'm hope you will find your answer here.

dfranz
02-11-2007, 01:09 AM
Thanks fos: The permissions are OK and I found the problem
by checking the search path used by Python for finding
modules. The PYTHONPATH variable on the problem machine
still had some old info in it and this proved to confuse the
search for the proper location of ccompiler.py.

Dogged persistence finally paid off. Of course the problem is
to know where to look to find the problem:) If I had a dollar
for everytime this happened to me since starting software
development in 1963, I would be a bit richer than I am now!

Should of waited for another hour before posting:)

fos
02-11-2007, 09:59 AM
I'm glad you solved your problem. Thanks for posting.

This is a small forum with a very good atmosphere. I hope you find something of interest and join us.

fos....