簡體   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