以管理员身份在 google 云 shell 上安装 python 模块

Install python module on google cloud shell as admin

我正在尝试使用 requirements.txt 文件在 google 云 shell 中安装此模块:https://pypi.org/project/kiteconnect/

但是,安装失败并出现以下错误:

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.7/site-packages/pycparser'
Consider using the `--user` option or check the permissions.

模块已知错误,需要以管理员用户身份 pip 安装在 python3.7 上: https://kite.trade/forum/discussion/5131/kiteconnect-installation-issue-for-python-3-7

我的问题是,如何在 google 云 shell 上以管理员权限 pip 安装此模块?非常感谢您的帮助!

假设您基于 Linux shell...

只需使用 sudo pip install.

这将 运行 pip 具有管理员权限。