ModuleNotFoundError in tracebacks with Python3.6 on linux

后端 未结 4 1046
不知归路
不知归路 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:24

    If most voted answer does not work for you please try below steps (Keep in mind you must change [version]):

    1. run this command sudo apt install python3-apt
    2. go to directory cd /usr/lib/python3/dist-packages
    3. run ls to find correct version of apt_pkg.cpython-[version]-i386-linux-gnu.so in my case it was 35m
    4. create a symlink sudo cp apt_pkg.cpython-[version]-i386-linux-gnu.so apt_pkg.so DON'T FORGET: type your [version]

    Troubleshouting

    If you get error cp: cannot stat 'apt_pkg.cpython-[your-version]-i386-linux-gnu.so': No such file or directory try commands below:

    1. rm -rf apt_pkg.so
    2. create a symlink sudo cp apt_pkg.cpython-[version]-i386-linux-gnu.so apt_pkg.so DON'T FORGET: type your [version]

提交回复
热议问题