首先查看一下pip安装的路径
sudo pip3 install requests(本人是python3)
Requirement already satisfied: requests in ./.local/lib/python3.6/site-packages
意思为当前目录下的.local(隐藏文件,ctrl+H显示)文件中
将路径添加到环境变量中
sudo gedit ~/.bashrc
export PYTHONPATH=$PYTHONPATH:"/home/hy/.local/lib/python3.6/site-packages"
source ~/.bashrc
OK!