简体   繁体   中英

python3 install module apiclient error in Jupyter notebooks

I am trying to connect the google analytics API to my Jupyter Notebook and I am getting an error when I try to install the libraries.

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

Error returned:

---------------------------------------------------------------------------
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'

I was basically using this demo and it worked when I ran it as a python app in terminal but when I moved the code over to jupyter it started throwing that error.

I've tried:

pip3 install --upgrade google-api-python-client in the terminal everything is up to date

!pip3 install google-api-python-client in the notebook and returns everything is up to date.

I am using anaconda for local jupyter install if that makes any difference. Any ideas on how to fix this or other things to try?

Try this other one:

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

If it doesnt work, download the zip here and Just unzip this into your App Engine project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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