2

It seems like I am getting some error related to Python, but I am not sure why I am getting it. When I ran Software Updater (in 12.10) from unity, it didn't even fire up.

When I did this from the terminal:

sudo update-manager

I am getting this trace, and update manager doesn't even open. I don't think this is a bug, so I am asking it here.

Traceback (most recent call last):
  File "/usr/bin/update-manager", line 28, in <module>
    from gi.repository import Gtk
  File "/usr/lib/python3/dist-packages/gi/repository/__init__.py", line 25, in <module>
    from ..importer import DynamicImporter
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 24, in <module>
    import logging
ImportError: No module named logging
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 4, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 15, in <module>
    import xml.dom, xml.dom.minidom
ImportError: No module named xml.dom

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/update-manager", line 28, in <module>
    from gi.repository import Gtk
  File "/usr/lib/python3/dist-packages/gi/repository/__init__.py", line 25, in <module>
    from ..importer import DynamicImporter
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 24, in <module>
    import logging
ImportError: No module named logging

However, apt-get commands work fine. Python seems to be installed properly(?), so I can't figure out what the trace is saying. Any idea what can I do to get back update-manager working?

2 Answers2

2

The modules logging and xml.dom come from python3.2-minimal and python3.2 respectively.

This should fix the problem:

sudo apt-get install --reinstall python3.2 python3.2-minimal
0

I had this problem after a ppa-purge command. I resolved it following the official Ubuntu Community Help on this page: The following are the commands listed.

Step 9 Ubuntu Software Center fails to open

If the Ubuntu Software Center fails to open, then please execute these Terminal commands:

sudo rm /usr/lib/python*/dist-packages/__pycache__/*pyc
sudo apt-get install --reinstall python3-gi
sudo apt-get purge software-center
rm -rf ~/.cache/software-center
rm -rf ~/.config/software-center
rm -rf ~/.cache/update-manager-core
sudo rm /var/lib/apt-xapian-index/cataloged_times.p
sudo rm /var/lib/apt-xapian-index/values
sudo update-apt-xapian-index --verbose --force
sudo update-apt-xapian-index --force
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install software-center ubuntu-desktop
sudo dpkg-reconfigure software-center --force
sudo update-software-center
sudo apt-get install --reinstall software-center

Then reboot and retest.

To make the process quicker, I made a .sh and copy/paste all commands listed in it. Execute, reboot, and done ! All works now : add-apt-repository, software-center, update-manager !

Hope this can help.

Pilot6
  • 92,041
berturion
  • 101