简体   繁体   English

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

[英]Install python module on google cloud shell as admin

I'm trying to install this module in google cloud shell with a requirements.txt file: https://pypi.org/project/kiteconnect/我正在尝试使用 requirements.txt 文件在谷歌云 shell 中安装此模块: https://pypi.org/project/kiteconnect/

However, the installation fails with this error:但是,安装失败并出现以下错误:

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.

It's a known error with the module that it needs to be pip installed on python3.7 as an admin user: https://kite.trade/forum/discussion/5131/kiteconnect-installation-issue-for-python-3-7这是模块的一个已知错误,它需要以管理员用户身份安装在 python3.7 上的 pip: https://kite.trade/forum/discussion/5131/kiteconnect-installation-issue-for-python-3-7

My question is, how do I pip install this module with admin rights on google cloud shell?我的问题是,我如何 pip 在谷歌云 shell 上安装这个具有管理员权限的模块? Your help is greatly appreciated!非常感谢您的帮助!

Assuming you are on a Linux-based shell...假设您使用的是基于 Linux 的 shell...

Just use sudo pip install .只需使用sudo pip install

This will run pip with admin privileges.这将以管理员权限运行pip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM