繁体   English   中英

在Jupyter笔记本中的python3安装模块apiclient错误

[英]python3 install module apiclient error in Jupyter notebooks

我正在尝试将google analytics API连接到我的Jupyter笔记本,当我尝试安装库时出现错误。

import argparse

from apiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials

import httplib2
from oauth2client import client
from oauth2client import file
from oauth2client import tools

错误返回:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-4-4f9f833c28f1> in <module>()
      1 import argparse
      2 
----> 3 from apiclient.discovery import build
      4 from oauth2client.service_account import ServiceAccountCredentials
      5 

ModuleNotFoundError: No module named 'apiclient'

我基本上使用这个演示 ,当我在终端中将它作为python应用程序运行时它工作但是当我将代码移动到jupyter时它开始抛出该错误。

我试过了:

pip3 install --upgrade google-api-python-client在终端中一切都是最新的

!pip3 install google-api-python-client在笔记本中!pip3 install google-api-python-client并返回一切都是最新的。

我使用anaconda进行本地jupyter安装,如果这有任何区别。 关于如何解决这个或其他事情的任何想法尝试?

试试另一个:

pip install --force-reinstall google-api-python-client

如果它不起作用,请在此处下载zip并将其解压缩到App Engine项目中。

暂无
暂无

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

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