一、问题描述
今天使用pip安装库的时候和一些模块的时候,出现了一下报错信息:
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
大概意思就是:提示以“root”用户身份运行 pip 可能会导致权限损坏和冲突,因此我们需要创造一个虚拟的环境区执行它
解决办法
1、创建一个虚拟环境
python3 -m venv tutorial-env
2、接着在命令行执行下面命令
source tutorial-env/bin/activate