TransWikia.com

No module named apt_pkg

elementary OS Asked by Fatih19 on October 31, 2020

Had this error while trying to install Lutris :sudo add-apt-repository ppa:lutris-team/lutris and then this came out :

 Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 11, in <module>
    from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 28, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Seems like the problem is something about python?

One Answer

It seems that you've upgraded python3 version. As explained here https://askubuntu.com/a/1191220/607679; because of the python3 update, usr/bin/python3 points to a python that does not have apt_pkg.

You can create symlink like below. This should your problem.

ln -s /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so /usr/lib/python3/dist-packages/apt_pkg.so

Answered by tyro on October 31, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP