3

I have a notification nearly every time I try to update. That note 'An error occurred while checking for updates => [TR Language] Güncellemeler denetlenirken bir sorun oluştu.'

I can't open software updater, languages, Unity tweak tool.

$ sudo unity-tweak-tool

enter code here Traceback (most recent call last): File "/usr/bin/unity-tweak-tool", line 33, in import UnityTweakTool File "/usr/lib/python3/dist-packages/UnityTweakTool/init.py", line 39, in import dbus, dbus.service File "/usr/lib/python2.7/dist-packages/dbus/init.py", line 82, in import dbus.types as types File "/usr/lib/python2.7/dist-packages/dbus/types.py", line 6, in from _dbus_bindings import ( ImportError: /usr/lib/python2.7/dist-packages/_dbus_bindings.so: undefined symbol: _Py_ZeroStruct Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in from apport.report import Report File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in import apport.fileutils File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in from apport.packaging_impl import impl as packaging File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in import apt File "/usr/lib/python2.7/dist-packages/apt/init.py", line 23, in import apt_pkg ImportError: /usr/lib/python2.7/dist-packages/apt_pkg.so: undefined symbol: _Py_ZeroStruct

Original exception was: Traceback (most recent call last): File "/usr/bin/unity-tweak-tool", line 33, in import UnityTweakTool File "/usr/lib/python3/dist-packages/UnityTweakTool/init.py", line 39, in import dbus, dbus.service File "/usr/lib/python2.7/dist-packages/dbus/init.py", line 82, in import dbus.types as types File "/usr/lib/python2.7/dist-packages/dbus/types.py", line 6, in from _dbus_bindings import ( ImportError: /usr/lib/python2.7/dist-packages/_dbus_bindings.so: undefined symbol: _Py_ZeroStruct

The following description is suggestions

Print import sys and sys.path

$ python
>>import sys
>>sys.path
''
['', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']

which python and python --version

~$ which python
/usr/bin/python


~$ python --version
Python 2.7.6
  • That looks like a messed up Python installation. Try sudo apt-get install --reinstall python-dbus python-apt and post whether it worked and eventually occurred error messages. You have to leave me a comment (@ByteCommander) once you edited your question to notify me. Thanks. – Byte Commander Apr 9 '15 at 15:27
  • i tried but not change. Same errors @ByteCommander – RoCkBanG26 Apr 9 '15 at 17:09
  • Similar question here: askubuntu.com/q/420852/367990 – Byte Commander Apr 9 '15 at 17:12
  • Could you try and run python in a terminal and when the prompt >>> shows up, enter import sys, and then sys.path. Exit python with [Ctrl+D] and edit your question to add the output. – Byte Commander Apr 9 '15 at 17:46
  • import sys run but sys.path isnt run. @ByteCommander `` >>sys.path '' ['', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client'] `` – RoCkBanG26 Apr 9 '15 at 17:55
1

If you look at the top of the backtrace you will notice that UnityTweakTool is a Python 3 library. However your PYTHONPATH contains a lot of directories referring to your Python 2 installation. The problematic one is /usr/lib/python2.7/dist-packages, which causes the incompatible Python 2 version of the apt package to be picked up.

Try unsetting your PYTHONPATH or run as

sudo PYTHONPATH= unity-tweak-tool

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.