[Python-projects] ImportError importing astng.utils instead of logilab.astng.utils

Sylvain Thénault sylvain.thenault at logilab.fr
Tue Nov 18 14:09:48 CET 2008


On Fri, Nov 07, 2008 at 10:38:06PM +0000, Gunnlaugur Thor Briem wrote:
> Hi,
> 
> don't know if this is the same problem, but I am getting the following when
> trying to run PyLint:
> 
> Traceback (most recent call last):
...
> "/Users/gthb/Library/Python/2.5/site-packages/pylint-0.15.2-py2.5.egg/pylint/checkers/__init__.py",
> line 42, in <module>
>     from logilab.astng.utils import ASTWalker
> ImportError: No module named astng.utils
> 
> These are the eggs installed, as seen in easy-install.pth in site-packages:
> 
> ./pylint-0.15.2-py2.5.egg
> ./logilab_common-0.36.0-py2.5.egg
> ./logilab_astng-0.17.3-py2.5.egg
> 
> The module logilab.astng.utils is definitely present inside the latter
> directory, i.e. the file:
> 
> ./logilab_astng-0.17.3-py2.5.egg/logilab/astng/utils.py
> 
> So the problem seems to be that for whatever reason, python tries to import
> astng.utils instead of logilab.astng.utils. Any idea why? python -v reveals
> nothing.
> 
> This happens also when I try, from the command line:
> 
> python -c "import logilab.astng.utils"
> 
> so the problem is not particular to the python environment at the point
> where pylint tries to import it.
> 
> Any idea what is going on here?

I think the problem is coming from the fact that both logilab-common and
logilab-astng are in the logilab package, and while looking for logilab.astng,
python found hte logilab package in the logilab-common egg, don't find astng 
here and then stop with an ImportError. IIRC this is the reason why we don't 
support eggs/easy_install at this time.

-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Python et calcul scientifique:           http://www.logilab.fr/science



More information about the Python-Projects mailing list