NetBSD Problem Report #48068

From  Fri Jul 19 16:06:24 2013
Return-Path: <>
Received: from ( [])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "", Issuer "Postmaster" (verified OK))
	by (Postfix) with ESMTPS id 8840A71E28
	for <>; Fri, 19 Jul 2013 16:06:24 +0000 (UTC)
Message-Id: <>
Date: Fri, 19 Jul 2013 16:06:22 +0000 (UTC)
Subject: lang/python27 fails to build with `ImportError: No module named _sysconfigdata'
X-Send-Pr-Version: www-1.0

>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
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
`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/", line 548, in <module>
  File "/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/", line 530, in main
    known_paths = addusersitepackages(known_paths)
  File "/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/", line 266, in addusersitepackages
    user_site = getusersitepackages()
  File "/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/", 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/", line 231, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/", line 516, in get_config_var
    return get_config_vars().get(name)
  File "/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/", line 468, in get_config_vars
  File "/home/vital303/pkgsrc/lang/python27/work/Python-2.7.5/Lib/", 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 ( was backported
to python2 from python3):
[Python 3.3] Most of Python's startup time is sysconfig
[Python 3.3] doesn't support multiple build configurations
[Python 3.3, 3.4] _sysconfigdata is generated in srcdir, not builddir

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

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

/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/  -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/", line 16, in <module>
    import struct
  File "/home/vital303/pkgsrc/lang/python27/work/.destdir/home/vital303/netbsd/lib/python2.7/", line 1, in <module>
    from _struct import *
ImportError: No module named _struct
*** Error code 1

I found the following bug report
[Python 2.7] make install error: ImportError: No module named _struct

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

`bmake build' in lang/python27

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.