ModuleNotFoundError in tracebacks with Python3.6 on linux

后端 未结 4 1045
不知归路
不知归路 2021-01-01 21:15

I installed Python 3.6 on Ubuntu 16.04 by using Jonathon Fernyhough\'s PPA:

sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get         


        
4条回答
  •  没有蜡笔的小新
    2021-01-01 21:38

    I solved this issue for Python 3.6 by first installing the python-apt package for Python 3:

    sudo apt install python3-apt
    

    After that, I changed to the dist-packages directory and copied the apt_pkg[...].so file to the new default file name apt_pkg.so, to be also recognized by Python 3.6:

    cd /usr/lib/python3/dist-packages
    sudo cp apt_pkg.cpython-34m-i386-linux-gnu.so apt_pkg.so
    

    Now all ModuleNotFoundError: No module named 'apt_pkg' exceptions disappeared on expectedly thrown error messages.

提交回复
热议问题