没有名为“softwareproperties”的模块

没有名为“softwareproperties”的模块

我之前手动删除了系统自带的python2和python3,然后又手动安装了,运行命令sudo add-apt-repository ppa:xxxx就会出现这个错误,请问如何解决?

➜  ~ sudo add-apt-repository ppa:gnome-terminator            
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 12, in <module>
    from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
ModuleNotFoundError: No module named 'softwareproperties'
➜  ~ python --version 
Python 2.7.18
➜  ~ python3 --version
Python 3.8.11
➜  ~ which pip3
/home/jingmian/.local/bin/pip3
➜  ~ which pip 
/home/jingmian/.local/bin/pip
➜  ~ which python3
/usr/local/bin/python3
➜  ~ which python 
/usr/bin/python
➜  ~ uname -a                                    
Linux jingmian-X3 5.15.0-76-generic #83~20.04.1-Ubuntu SMP Wed Jun 21 20:23:31 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

我继续执行下面的命令,但是也提示失败。

➜  ~ sudo apt install --reinstall python3-software-properties
Reading package list... complete
Analyzing the dependency tree for the package
Reading status information... complete
The following software will be installed:
python3-apt software-properties-common
Recommended installation:
python3-apt-dbg python-apt-doc
The following packages will be upgraded:
python3-apt python3-software-properties software-properties-common
3 software packages were upgraded, 0 software packages were newly installed, 0 software packages were uninstalled, and 392 software packages were not upgraded.
13 packages were not fully installed or uninstalled.
You need to download the 0 B/234 kB archive.
Decompressing will consume 0 B of extra space.
Do you want to proceed? [Y/n] Y
(Reading the database... There are 418,616 files and directories installed on the system.
Prepare to decompress... /python3-apt_2.0.1ubuntu0.20.04.1_amd64.deb...
Traceback (most recent call last):
File "/usr/bin/py3clean", line 32, in <module>
from debpython import files as dpf
ModuleNotFoundError: No module named 'debpython'
dpkg: Warning: The old python3-apt package pre-removal script subprocess returns error status 1
dpkg: Now try using the script that comes with the new package...
Traceback (most recent call last):
File "/usr/bin/py3clean", line 32, in <module>
from debpython import files as dpf
ModuleNotFoundError: No module named 'debpython'
DPKG: processing file/var/cache/apt/archives/python3 - apt_2. 0.1 ubuntu0.20.04.1 _amd64. Deb error (- unpack) :
The new python3-apt package pre-removal script subprocess returns error status 1
Traceback (most recent call last):
File "/usr/bin/py3compile", line 34, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
ModuleNotFoundError: No module named 'debpython'
dpkg: Error while cleaning:
The python3-apt package has been installed. The post-installation script subprocess returns error status 1
Prepare to decompress... / software-property-common_0.99.9.12_all.deb...
Traceback (most recent call last):
File "/usr/bin/py3clean", line 32, in <module>
from debpython import files as dpf
ModuleNotFoundError: No module named 'debpython'
dpkg: Warning: The old software-property-common package pre-removal script subprocess returned an error
False state 1
dpkg: Now try using the script that comes with the new package...
Traceback (most recent call last):
File "/usr/bin/py3clean", line 32, in <module>
from debpython import files as dpf
ModuleNotFoundError: No module named 'debpython'
DPKG: processing file/var/cache/apt/archives/software - the properties - common_0. 99.9.12 _all.
Error when deb (--unpack) :
The new software-property-common package pre-removal script subprocess returns error status 1
Traceback (most recent call last):
File "/usr/bin/py3compile", line 34, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
ModuleNotFoundError: No module named 'debpython'
dpkg: Error while cleaning:
The post-installation script subprocess of the installed software-property-common software package returns an error
State 1
Prepare to decompress... /python3-software-properties_0.99.9.12_all.deb...
Traceback (most recent call last):
File "/usr/bin/py3clean", line 32, in <module>
from debpython import files as dpf
ModuleNotFoundError: No module named 'debpython'
dpkg: Warning: Return of the old python3-software-properties package pre-removal script subprocess
Error status 1
dpkg: Now try using the script that comes with the new package...
Traceback (most recent call last):
File "/usr/bin/py3clean", line 32, in <module>
from debpython import files as dpf
ModuleNotFoundError: No module named 'debpython'
DPKG: processing file/var/cache/apt/archives/python3 - software - properties_0. 99.9.12 _all
Error when.deb (--unpack) :
The new python3-software-properties package pre-removal script subprocess returns error status 1
Traceback (most recent call last):
File "/usr/bin/py3compile", line 34, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
ModuleNotFoundError: No module named 'debpython'
dpkg: Error while cleaning:
The python3-software-properties package has been installed. The post-installation script subprocess returns an error. Procedure
State 1
An error occurred while processing:
The/var/cache/apt/archives/python3 - apt_2. 0.1 ubuntu0.20.04.1 _amd64. Deb
The/var/cache/apt/archives/software - the properties - common_0. 99.9.12 _all. Deb
The/var/cache/apt/archives/python3 - software - properties_0. 99.9.12 _all. Deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

相关内容