【发布时间】:2017-07-12 04:25:03
【问题描述】:
当我尝试时:
sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
在 Ubuntu 中,终端显示此错误消息:
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 27, in <module>
import apt_pkg
ImportError: No module named 'apt_pkg'
我有两个版本的python,一个是2.7,一个是3.5。
如何在 python3.5 上安装这个包?
【问题讨论】:
-
为什么要安装 Python 3.5 的包?很可能它是一个特定于 Ubuntu 的系统包,它与默认系统 Python(即 2.7.x)捆绑在一起
-
其实你并没有安装任何东西,你只是在系统中添加了一个ppa。对我来说,这看起来像是
/usr/bin/add-apt-repository(这是一个 Python3 脚本)中的一个错误。
标签: python importerror apt