Could not install packages due to an EnvironmentError: [Errno 13] Permission denied

mac在实用pip3安装包时发现报如下异常:

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/3.7'
Consider using the `--user` option or check the permissions.

提示是说,由于环境问题不能安装包,访问库没有权限,你可以考虑使用--user或者检查权限。
原因是pip执行的是root权限,而当前用户不是,两种方案:

1.让当前用户在root权限下执行:sudo pip3…
2.让pip3在当前用户下执行:pip3…–user

猜你喜欢

转载自blog.csdn.net/Logicr/article/details/103918537