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

Bug #1115466 reported by Mar-castelluccio
104
This bug affects 24 people
Affects Status Importance Assigned to Milestone
python2.7 (Ubuntu)
Invalid
Undecided
Unassigned
virtualenv (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

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

Revision history for this message
Mar-castelluccio (mar-castelluccio) wrote :
affects: python-defaults (Ubuntu) → python2.7 (Ubuntu)
Revision history for this message
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
Revision history for this message
Mar-castelluccio (mar-castelluccio) wrote :
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
\"\"\"Bootstra...sys.argv[1:])

" /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
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 971, in run_command
    cmd_obj.ensure_finalized()
  File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
    self.finalize_options()
  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
    cmd_obj.ensure_finalized()
  File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
    self.finalize_options()
  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
    func()
  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...

Read more...

Revision history for this message
Mar-castelluccio (mar-castelluccio) wrote :

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

Revision history for this message
Mar-castelluccio (mar-castelluccio) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in virtualenv (Ubuntu):
status: New → Confirmed
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Mar-castelluccio (mar-castelluccio) wrote :

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
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
Karel Vervaeke (karel-vervaeke) wrote :

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

Revision history for this message
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.

Revision history for this message
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 .

Revision history for this message
Wim Feijen (wimfeijen) wrote :

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

Revision history for this message
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?

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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