我有 Linux Mint 19.3 Cinnamon,内核 4.15.0-124-generic。
我对Python安装进行了很多尝试和错误,恐怕现在已经搞砸了。 python 和 python3 命令都可以工作(尽管它们指向不同的版本):
denis@denis-hp ~ $ python
Python 3.7.10 (default, Feb 20 2021, 21:17:23)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
denis@denis-hp ~ $ python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
但是一些使用 python 的程序,包括pip
(但不包括pip3
)会引发以下错误:
denis@denis-hp ~ $ pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pip._internal.cli.main import main
File "/home/denis/.local/lib/python3.7/site-packages/pip/_internal/cli/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/home/denis/.local/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/home/denis/.local/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/home/denis/.local/lib/python3.7/site-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "/home/denis/.local/lib/python3.7/site-packages/pip/_internal/cli/progress_bars.py", line 11, in <module>
from pip._internal.utils.compat import WINDOWS
File "/home/denis/.local/lib/python3.7/site-packages/pip/_internal/utils/compat.py", line 14, in <module>
import shutil
ModuleNotFoundError: No module named 'shutil'
在尝试了很多事情并在谷歌上搜索错误但没有成功后,我出于绝望而在这里发帖...提前感谢您的帮助。