Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install 安装 Python 依赖时权限问题的解决 #204

Open
wayou opened this issue Jun 14, 2020 · 0 comments
Open

pip install 安装 Python 依赖时权限问题的解决 #204

wayou opened this issue Jun 14, 2020 · 0 comments

Comments

@wayou
Copy link
Owner

wayou commented Jun 14, 2020

pip install 安装 Python 依赖时权限问题的解决

从 Github clone Python 项目,安装依赖时报如下错误:

$ pip install -r requirements.txt
...
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: 'RECORD'
Consider using the `--user` option or check the permissions.

原因是尝试安装包到系统目录,而当前用户没有该目录的权限。

解决办法有三种:

  • 设置 Python 的虚拟环境(推荐):
python3 -m venv env
source ./env/bin/activate 
# 如果是 fish
source ./env/bin/activate.fish

然后再次尝试安装即可成功。

  • 将包安装到用户目录:
python -m pip install --user google-assistant-sdk[samples]
  • 使用系统管理员身份安装:
sudo python -m pip install google-assistant-sdk[samples]

相关资源

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant