当我尝试sudo add-apt-repository ppa:webupd8team/java
ubuntu终端显示此错误消息。
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 11, in <module>
from softwareproperties.SoftwareProperties import SoftwareProperties
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 21, in <module>
import apt_pkg
虽然我尝试了apt-get install python3-apt
但仍然无法正常工作(我也尝试在删除后再次重新安装),我也试过了pip3 install apt-pkg
但它说
Downloading/unpacking apt-pkg
Could not find any downloads that satisfy the requirement apt-pkg
No distributions at all found for apt-pkg
Storing complete log in /home/kim/.pip/pip.log
当然,导入apt_pkg也不能在python3中工作(但它在python2.7中运行,我有两个版本的python,一个是2.7,另一个是3.3)
如何在python3上安装此软件包