Python pip3安装错误:(ValueError:源代码字符串不能包含空字节)

Python pip3安装错误:(ValueError:源代码字符串不能包含空字节),python,ubuntu,pip,Python,Ubuntu,Pip,我正在尝试使用pip3安装软件包,例如,以下命令: sudo pip3 install testresources setuptools==49.6.0 但是,得到以下错误: Traceback (most recent call last): File "/usr/bin/pip3", line 9, in <module> from pip import main ValueError: source code string cannot co

我正在尝试使用pip3安装软件包,例如,以下命令:

sudo pip3 install testresources setuptools==49.6.0 
但是,得到以下错误:

Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ValueError: source code string cannot contain null bytes
回溯(最近一次呼叫最后一次):
文件“/usr/bin/pip3”,第9行,在
从pip导入主
ValueError:源代码字符串不能包含空字节
我所尝试的:

通过
purge
移除pip3,然后通过
sudo apt get install python3 pip重新安装


如果有帮助,python版本是3.6.9。

可能重复:@TheBotlyNoob肯定不是重复!你提到的帖子是关于MacOS中的一个图形库,但我的帖子是关于在ubuntu中安装任何带有pip3的软件包!如果进行单用户安装,是否仍会发生这种情况
pip3安装——用户testresources setuptools==49.6.0
似乎
pip3
已损坏。不清楚是快捷方式
/usr/bin/pip3
还是pip模块本身。你能试着运行
sudopython3-mpipinstall
?@Marat这个命令得到同样的错误!