Python 中的问题(ubuntu)

Python 中的问题(ubuntu)

当我尝试安装此程序时,出现此错误;解决办法是什么?

ubuntu@ip-xxx-xxx-xxx-xxx:~/URLuploader-With-Hotstar$ pip3 install -r requirements.txt
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
  File "/usr/lib/python3/dist-packages/pip/__init__.py", line 14, in <module>
    from pip.utils import get_installed_distributions, get_prog
  File "/usr/lib/python3/dist-packages/pip/utils/__init__.py", line 23, in <module>
    from pip.locations import (
  File "/usr/lib/python3/dist-packages/pip/locations.py", line 9, in <module>
    from distutils import sysconfig
ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/__init__.py)

答案1

看来您缺少python3-distutils软件包,请通过以下方式安装:

sudo apt install python3-distutils

也可以看看:

答案2

您需要将python3.8-distutils合适的包安装到您的 python 版本 ( python3.8):

sudo apt install python3.8-distutils

切换到python3.8按照这个答案

重新安装pip3

sudo apt remove python3-pip
cd /tmp
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.8 get-pip.py
pip3 install pyrogram

相关内容