This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ./configure: ImportError: No module named asdl (when run from buildout's python)
Type: compile error Stage: resolved
Components: Build, Interpreter Core Versions: Python 3.1, Python 2.6
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, r.david.murray, srid
Priority: normal Keywords:

Created on 2010-03-26 02:13 by srid, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
config.log srid, 2010-03-26 02:36 config.log for release3.1-maint/macosx
pyconfig.h srid, 2010-03-26 02:36 pyconfig.h for release3.1-maint/macosx
Messages (8)
msg101738 - (view) Author: Sridhar Ratnakumar (srid) Date: 2010-03-26 02:13
I'm seeing this error with 2.6 and 3.1 maint branches (not sure about 2.7) on both Linux & Mac 32-bit builds. Does not happen on Linux 64-bit though. Also this is possibly caused by a recent commit, as we never saw this issue before.

[...]
creating Makefile
./Parser/asdl_c.py -h ./Include ./Parser/Python.asdl
Traceback (most recent call last):
  File "/home/apy/as/pypm-trunk/bin/python", line 49, in <module>
    execfile(__file__)
  File "./Parser/asdl_c.py", line 9, in <module>
    import asdl
ImportError: No module named asdl
make: *** [Include/Python-ast.h] Error 1
msg101749 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-03-26 14:46
I can't reproduce this on 2.6 maint on Linux 32 bit (Gentoo).

Did you try doing a make distclean before redoing the configure/make?
msg101834 - (view) Author: Sridhar Ratnakumar (srid) Date: 2010-03-27 18:28
I didn't have to run 'make distclean', because this is a fresh clone.

$ hg clone http://code.python.org/hg/branches/release2.6-maint/
$ cd release2.6-maint
$ ./configure --prefix=`pwd`/i

$ make
./Parser/asdl_c.py -h ./Include ./Parser/Python.asdl
Traceback (most recent call last):
  File "/home/apy/as/pypm-trunk/bin/python", line 49, in <module>
    execfile(__file__)
  File "./Parser/asdl_c.py", line 9, in <module>
    import asdl
ImportError: No module named asdl
make: *** [Include/Python-ast.h] Error 1
msg101835 - (view) Author: Sridhar Ratnakumar (srid) Date: 2010-03-27 18:31
Ah, I see what is happening. My $PATH has a buildout's python (bin/python) path. Apparently that is messing up with sys.path. Using /usr/local/bin/python, for instance, in $PATH does not give this problem.
msg101838 - (view) Author: Sridhar Ratnakumar (srid) Date: 2010-03-27 18:34
I am not sure how "import asdl" works.
msg101915 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-03-30 04:24
Python is used to build python.  Theoretically you should be able to avoid that rebuild. cf the following thread:

http://mail.python.org/pipermail/python-dev/2006-April/063511.html

and the referenced issue 1465408.  asdl_c.py is going to be importing asdl.py from the same directory it is run from (it is run as a script).  So the question is, why is your buildout python failing to support that import?
msg101916 - (view) Author: Sridhar Ratnakumar (srid) Date: 2010-03-30 04:29
> why is your buildout python failing to support that import?

I believe it is because "" (current directory) is not in sys.path for buildout python. Buildout explicitly sets sys.path. Perhaps that's why.

Feel free to close this issue.
msg101920 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-03-30 06:33
That sounds like the likely explanation.
History
Date User Action Args
2022-04-11 14:56:59adminsetgithub: 52483
2010-03-30 06:33:54r.david.murraysetstatus: open -> closed
resolution: works for me
messages: + msg101920

stage: resolved
2010-03-30 04:29:02sridsetmessages: + msg101916
2010-03-30 04:24:07r.david.murraysetpriority: high -> normal

messages: + msg101915
2010-03-27 18:34:36sridsetmessages: + msg101838
2010-03-27 18:31:50sridsetmessages: + msg101835
title: ./configure: ImportError: No module named asdl -> ./configure: ImportError: No module named asdl (when run from buildout's python)
2010-03-27 18:28:36sridsetmessages: + msg101834
2010-03-26 14:46:15r.david.murraysetpriority: high
nosy: + r.david.murray, benjamin.peterson
messages: + msg101749

2010-03-26 02:36:28sridsetfiles: + pyconfig.h
2010-03-26 02:36:12sridsetfiles: + config.log
2010-03-26 02:13:39sridcreate