pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/48068: lang/python27 fails to build with `ImportError: No module named _sysconfigdata'



>Number:         48068
>Category:       pkg
>Synopsis:       lang/python27 fails to build with `ImportError: No module 
>named _sysconfigdata'
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 19 16:10:00 +0000 2013
>Originator:     LItvinov Sergey
>Release:        Ubuntu Linux
>Organization:
>Environment:
Linux acer 3.8.0-26-generic #38-Ubuntu SMP Mon Jun 17 21:43:33 UTC 2013 x86_64 
x86_64 x86_64 GNU/Linux
>Description:
`bmake build' fails with the following error

===> Building for python27-2.7.5
--- sharedmods ---
Traceback (most recent call last):
  File "/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/site.py", 
line 548, in <module>
    main()
  File "/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/site.py", 
line 530, in main
    known_paths = addusersitepackages(known_paths)
  File "/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/site.py", 
line 266, in addusersitepackages
    user_site = getusersitepackages()
  File "/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/site.py", 
line 241, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/site.py", 
line 231, in getuserbase
    USER_BASE = get_config_var('userbase')
  File 
"/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/sysconfig.py", line 
516, in get_config_var
    return get_config_vars().get(name)
  File 
"/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/sysconfig.py", line 
468, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File 
"/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/sysconfig.py", line 
352, in _init_posix
    from _sysconfigdata import build_time_vars
ImportError: No module named _sysconfigdata
*** [sharedmods] Error code 1

bmake: stopped in /home/vital303/pkgsrc/lang/python27/work/Python-2.7.5
1 error

I think those reports are relevant (_sysconfigdata.py was backported
to python2 from python3):
[Python 3.3] Most of Python's startup time is sysconfig
http://bugs.python.org/issue13150
[Python 3.3] _sysconfigdata.py doesn't support multiple build configurations
http://bugs.python.org/issue14774
[Python 3.3, 3.4] _sysconfigdata is generated in srcdir, not builddir
http://bugs.python.org/issue15298

I copied 
cp ./work/Python-2.7.5/build/lib.linux-x86_64-2.7/_sysconfigdata.py 
./work/Python-2.7.5/Lib/
and did
bmake build

The build goes further but fails with the following error during installation

#+BEGIN_EXAMPLE
/usr/bin/install -c -o vital303 -g vital303 -m 755 ./Lib/plat-linux2/regen 
/home/vital303/netbsd/lib/python2.7/plat-linux2
/usr/bin/install -c -o vital303 -g vital303 -m 644 ./LICENSE 
/home/vital303/pkgsrc/lang/python27/work/.destdir/home/vital303/netbsd/lib/python2.7/LICENSE.txt
if test -d 
/home/vital303/pkgsrc/lang/python27/work/.destdir/home/vital303/netbsd/lib/python2.7/distutils/tests;
 then  /usr/bin/install -c -o vital303 -g vital303 -m 644 ./Modules/xxmodule.c  
/home/vital303/pkgsrc/lang/python27/work/.destdir/home/vital303/netbsd/lib/python2.7/distutils/tests
 ;  fi
PYTHONPATH=/home/vital303/pkgsrc/lang/python27/work/.destdir/home/vital303/netbsd/lib/python2.7
  LD_LIBRARY_PATH=/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5:  
./python -E -Wi -tt 
/home/vital303/pkgsrc/lang/python27/work/.destdir/home/vital303/netbsd/lib/python2.7/compileall.py
  -d /home/vital303/netbsd/lib/python2.7 -f  -x 
'bad_coding|badsyntax|site-packages|lib2to3/tests/data'  
/home/vital303/pkgsrc/lang/python27/work/.destdir/home/vital303/netbsd/lib/python2.7
Traceback (most recent call last):
  File 
"/home/vital303/pkgsrc/lang/python27/work/.destdir/home/vital303/netbsd/lib/python2.7/compileall.py",
 line 16, in <module>
    import struct
  File 
"/home/vital303/pkgsrc/lang/python27/work/.destdir/home/vital303/netbsd/lib/python2.7/struct.py",
 line 1, in <module>
    from _struct import *
ImportError: No module named _struct
*** Error code 1
#+END_EXAMPLE

I found the following bug report
[Python 2.7] make install error: ImportError: No module named _struct
http://bugs.python.org/issue15066

I can get the same error message if I do
./work/Python-2.7.5/python -c "import struct"
ImportError: No module named _struct

But if I copy python binary to another directory:
cp ./work/Python-2.7.5/python .
./python -c "import struct"
gives no error

If I revert `lang/python27' to python 2.7.4 installation goes without
errors.

>How-To-Repeat:
`bmake build' in lang/python27
>Fix:



Home | Main Index | Thread Index | Old Index