update-manager fails to upgrade from quantal to raring No module named '_sysconfigdata_m'

Bug #1192890 reported by David Ireland
32
This bug affects 7 people
Affects Status Importance Assigned to Milestone
python3.3 (Ubuntu)
Confirmed
Undecided
David Ireland
python3.4 (Ubuntu)
Confirmed
Undecided
Unassigned
python3.5 (Ubuntu)
New
Undecided
Unassigned

Bug Description

I ran update manager and chose to upgrade to raring. The packages all downloaded. On installation, I repeatedly saw something like this in the console:

  File "/usr/lib/python3.3/site.py", line 633, in <module>
    main()
  File "/usr/lib/python3.3/site.py", line 618, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python3.3/site.py", line 284, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python3.3/site.py", line 260, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python3.3/site.py", line 250, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python3.3/sysconfig.py", line 610, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python3.3/sysconfig.py", line 560, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python3.3/sysconfig.py", line 432, in _init_posix
    from _sysconfigdata import build_time_vars
  File "/usr/lib/python3.3/_sysconfigdata.py", line 6, in <module>
    from _sysconfigdata_m import *
ImportError: No module named '_sysconfigdata_m'

Eventually, update-manager silently exited.

Now when I try to start it again from gnome-terminal, I see the above, and update-manager immediately exits.

In fact, python3.3 doesn't run, with the same error, and

apt-get install python3.3

Results in the same error repeatedly

_sysconfigdata_m.py is in

http://packages.ubuntu.com/raring/amd64/libpython3.3-minimal/filelist

But it wasn't installed, so I installed it by hand using dpkg.

python3.3 still doesn't run, but now I

apt-get install python3.3

without seeing this error, and all the unconfigured packages from the upgrade get configured.

The reporting guidelines don't seem to apply to upgrade issues, but for completeness

$ lsb_release -rd
Description: Ubuntu 13.04
Release: 13.04

What I expected: I expected update-manager to upgrade my system, or to report that it had failed
What happened: update-manager exited, without reporting failure, leaving my system in an unusable state

Tags: bot-comment
Revision history for this message
David Ireland (e-david) wrote :

This seems to be because I had python3 from a backport installed. It's not obvious why it wasn't upgraded, but it's not going to affect many people.

Changed in ubuntu:
assignee: nobody → David Ireland (e-david)
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1192890/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in ubuntu:
status: New → Confirmed
Revision history for this message
jamie pate (jamie-pate) wrote :

Not sure this is correct, seems to be a software updater/apt-get issue that caused partial upgrade?
Still unable to get apt running again, (or software updater)

affects: ubuntu → python3.3 (Ubuntu)
Revision history for this message
Jan (jankanis) wrote :

I'm running into the same issue, and I also had python3.3 installed already from backports. What is the workaround to get _sysconfigdata_m installed correctly? The package installs it at
/usr/lib/python3.3/plat-x86_64-linux-gnu/_sysconfigdata_m.py
but python can't find it overthere. I can symlink or copy it to /usr/lib/python3.3/ or I can set $PYTHONPATH to also look in plat-x86_64-linux-gnu, so what is the system supposed to look like?

Revision history for this message
Jacob Gardner (jacob-v-gardner) wrote :

TL;DR
The issue for me lied in /etc/bash.bashrc

This line near the bottom:
python /usr/lib/command-not-found -- $1

should be:
/usr/lib/command-not-found -- $1

Long explanation follows:
I had the same issue. For me issue occurred whenever I mistyped a command.

/usr/lib/command-not-found is a python program.

I found that if I ran it like:
python3.3 /usr/lib/command-not-found bad-command
it ran fine, but
python /usr/lib/command-not-found bad-command

Resulted in:
Traceback (most recent call last):
  File "/usr/lib/python3.3/site.py", line 631, in <module>
    main()
  File "/usr/lib/python3.3/site.py", line 616, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python3.3/site.py", line 284, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python3.3/site.py", line 260, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python3.3/site.py", line 250, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python3.3/sysconfig.py", line 580, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python3.3/sysconfig.py", line 530, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python3.3/sysconfig.py", line 403, in _init_posix
    from _sysconfigdata import build_time_vars
  File "/usr/lib/python3.3/_sysconfigdata.py", line 6, in <module>
    from _sysconfigdata_m import *
ImportError: No module named '_sysconfigdata_m'

The issue lied in /etc/bash.bashrc

This line near the bottom:
python /usr/lib/command-not-found -- $1

 was invoking python 2.

Changing it to:
python3.3 /usr/lib/command-not-found -- $1

or just plain:
/usr/lib/command-not-found -- $1

fixed the problem for me :)

Revision history for this message
David Ireland (e-david) wrote :

OK - so your python 2 is broken (which is the problem). You have solved your specific issue by pointing a specific command at python 3 instead. That command now works. Your python 2 is still broken.

Revision history for this message
David Ireland (e-david) wrote :

An, you say it's python 2, but from the stack trace, it plainly isn't.

Revision history for this message
Matthew Bergkoetter (mbergkoetter) wrote :

This problem is probably related to:
https://bugs.launchpad.net/command-not-found/+bug/1480388

In that case a simple solution is to change a line in /usr/lib/command-not-found from:

os.execvp("python3", [sys.argv[0]] + sys.argv)

to:

os.execvp("/usr/bin/python3", [sys.argv[0]] + sys.argv)

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in python3.4 (Ubuntu):
status: New → Confirmed
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.