Ubuntu遇到问题“Could not install packages due to an EnvironmentError: [Errno 13] 权限不够: ”

Ubuntu在使用一些pip的时候会遇到:“Could not install packages due to an EnvironmentError: [Errno 13] 权限不够:”的问题。


在正常的命令后面加一个 --user即可:


在使用pip的相关命令时,使用国内源的速度更快:如下是使用了清华的国内源。


pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/ --user


这样会将Python 程序包安装到 $HOME/.local 路径下,其中包含三个字文件夹:bin,lib 和 share。