python, 解决:WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager
在使用pip过程中,如果出现如下提示:
则可以先CD进入Python安装目录,执行以下指令 :
假设Python3安装在/usr/local/python3
cd /usr/local/python3 python3 -m venv tutorial-env source tutorial-env/bin/activate
再次尝试pip命令:
解决
补充一个豆瓣安装源:
pip install 要安装的模块名 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com