_sysconfigdata_nd.py missing in /usr/lib/python2.7/

Bug #1115466 reported by Mar-castelluccio on 2013-02-04
This bug affects 24 people
Affects Status Importance Assigned to Milestone
python2.7 (Ubuntu)
virtualenv (Ubuntu)

Bug Description

The file is present on Debian.
This is causing virtualenv to fail, and probably other modules too.

affects: python-defaults (Ubuntu) → python2.7 (Ubuntu)
Matthias Klose (doko) wrote :

$ dpkg -S _sysconfigdata_nd.py
libpython2.7-minimal:amd64: /usr/lib/python2.7/plat-x86_64-linux-gnu/_sysconfigdata_nd.py

so it's there, and no, the (closed) Debian issues are not related. so what are you trying to report?

Changed in python2.7 (Ubuntu):
status: New → Incomplete
Download full text (4.7 KiB)

This is the build log, when I try to build Firefox:

Creating Python environment
Cannot find file /usr/include/x86_64-linux-gnu/python2.7 (bad symlink)
New python executable in /home/marco/Scrivania/FD/src/obj-x86_64-unknown-linux-gnu/_virtualenv/bin/python2.7
Not overwriting existing python script /home/marco/Scrivania/FD/src/obj-x86_64-unknown-linux-gnu/_virtualenv/bin/python (you must use /home/marco/Scrivania/FD/src/obj-x86_64-unknown-linux-gnu/_virtualenv/bin/python2.7)
Installing setuptools...................................
  Complete output from command /home/marco/Scrivani...ualenv/bin/python2.7 -c "#!python

" /home/marco/Scrivani...ols-0.6c11-py2.7.egg:
  Traceback (most recent call last):
  File "<string>", line 278, in <module>
  File "<string>", line 239, in main
  File "/home/marco/Scrivania/FD/src/python/virtualenv/virtualenv_support/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1712, in main
  File "/home/marco/Scrivania/FD/src/python/virtualenv/virtualenv_support/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
  File "/home/marco/Scrivania/FD/src/python/virtualenv/virtualenv_support/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
  File "/usr/lib/python2.7/distutils/dist.py", line 971, in run_command
  File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
  File "/home/marco/Scrivania/FD/src/python/virtualenv/virtualenv_support/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 125, in finalize_options
  File "/home/marco/Scrivania/FD/src/python/virtualenv/virtualenv_support/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1121, in _expand
  File "/usr/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
  File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
  File "/home/marco/Scrivania/FD/src/python/virtualenv/virtualenv_support/setuptools-0.6c11-py2.7.egg/setuptools/command/install.py", line 32, in finalize_options
  File "/usr/lib/python2.7/distutils/command/install.py", line 321, in finalize_options
    (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
  File "/home/marco/Scrivania/FD/src/obj-x86_64-unknown-linux-gnu/_virtualenv/lib/python2.7/distutils/__init__.py", line 92, in sysconfig_get_config_vars
    real_vars = old_get_config_vars(*args)
  File "/usr/lib/python2.7/distutils/sysconfig.py", line 503, in get_config_vars
  File "/usr/lib/python2.7/distutils/sysconfig.py", line 447, in _init_posix
    from _sysconfigdata import build_time_vars
  File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
    from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd
...Installing setuptool...


Moving the file from /usr/lib/python2.7/plat-x86_64-linux-gnu to /usr/lib/python2.7 solved my problem.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in virtualenv (Ubuntu):
status: New → Confirmed
Daniel Holbert (dholbert) wrote :

Marco's workaround in comment 4 here fixed the problem for me, too (though I used a symlink instead of moving the file).

Specifically, I ran these commands:
  cd /usr/lib/python2.7
  ln -s plat-x86_64-linux-gnu/_sysconfigdata_nd.py .
and I was able to build firefox after doing that.

Dimitri John Ledkov (xnox) wrote :

Python has been recently multiarched, virtualenv should be fixed to include multiarch python locations.
The comment #4 nor #7 are not "fixes" they just break co-installing python for multiple architectures.

No one said they are fixes. They are workarounds. However the problem was in the in-tree virtualenv in the Firefox source code.

Changed in virtualenv (Ubuntu):
status: Confirmed → Fix Released
Dimitri John Ledkov (xnox) wrote :

Cool, thanks for the update.

Changed in virtualenv (Ubuntu):
status: Fix Released → Invalid
Changed in python2.7 (Ubuntu):
status: Incomplete → Invalid
Dražen Lučanin (kermit666) wrote :

Yup, as Mar-castelluccio said - the problem could be in the currently packaged version of virtualenv. After upgrading to the latest version in the Cheese shop

    sudo pip install --upgrade virtualenv

the problem seems to be fixed.

sudo pip install --upgrade virtualenv did not seem to solve the problem in my case.
The workaround from comment #4 did.

Roberto Longobardi (seccanj) wrote :

With lubuntu 13.04, "sudo pip install --upgrade virtualenv" actually resolves the problem.

You will need to install pip, using "sudo apt-get install python-pip" first.

arky (arky) wrote :

Here is workaround for 13.04

cd /usr/lib/python2.7
sudo ln -s plat-x86_64-linux-gnu/_sysconfigdata_nd.py .

Wim Feijen (wimfeijen) wrote :

sudo pip install --upgrade virtualenv
works for me, on Ubuntu 13.10. Thanks!

Julien Eid (jeid64) wrote :

This is still a confirmed issue for us on 13.04 and 14.04. Debian has a fix merged already for multiple months and the workaround is not very good for those who need to package their applications and cannot update virtualenv using pip or mess with /usr/lib/python. Is it possible we can get the fix from Debian merged?

Bryce Nesbitt (bryce2) wrote :

See also the pip issues, which I found to be at the
heart of virtualenv issues https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1373254

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.