错误

  • WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

解决方法

#重新创建一个虚拟环境 
python3 -m venv env39
source env39/bin/activate

pip install xxx

更新pip


python3 -m pip install --upgrade pip
#使用国内源
python3 -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple/