鹅卵石和Python3

2024-03-29 11:56:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我编写了一个使用googlesheets API的基本python3脚本。它在默认为python3(Arch)的系统上工作。我试图在ubuntu14.04系统上运行相同的脚本,但是我无法加载apiclient库。我安装了推荐的 pip install --upgrade google-api-python-client 但是我注意到我只能在python2中加载库。在

我观察到的是:

~ $ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from googleapiclient import discovery
>>> quit()
~ $ python3
Python 3.4.3 (default, Nov 17 2016, 01:08:31)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from googleapiclient import discovery
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'googleapiclient'

有什么建议吗?在


Tags: or脚本defaultforlicenseon系统more
1条回答
网友
1楼 · 发布于 2024-03-29 11:56:36

Googleapiclient只安装在python2上(我猜这是您的默认python版本),而不是python3。在

使用以下命令在python3 env中安装Googleapiclient:

pip3 install  upgrade google-api-python-client

相关问题 更多 >