简体   繁体   English

在Ubuntu中安装python Google api

[英]Installation of python google api in Ubuntu

Below command is used for installing Google-API in python for Linux. 以下命令用于在Linux版python中安装Google-API。

  pip install --upgrade google-api-python-client

Below errors are shown by above command 下面的错误由上面的命令显示

File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main 主目录中的文件“ /usr/lib/python2.7/dist-packages/pip/basecommand.py”,第122行

status = self.run(options, args) 状态= self.run(选项,参数)

File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run 运行中的文件“ /usr/lib/python2.7/dist-packages/pip/commands/install.py”,第283行

requirement_set.install(install_options, global_options, root=options.root_path require_set.install(install_options,global_options,root = options.root_path

Always remember there would be many errors and disparencies if you try to install packages without virtual environment in python. 永远记住,如果尝试在python中没有虚拟环境的情况下安装软件包,将会有很多错误和差异。

I would like you to create a virtual environment as specified in the link and then try it out. 我希望您按照链接中的指定创建一个虚拟环境,然后尝试一下。

http://docs.python-guide.org/en/latest/dev/virtualenvs/ http://docs.python-guide.org/en/latest/dev/virtualenvs/

1) sudo -E pip install --upgrade pip

2) sudo -E pip install --upgrade google-api-python-client

Than environmental variables using flag -E is better 比使用标志-E的环境变量更好

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

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