Unable to resolve google dependencies
shikharvaish28 opened this issue · 7 comments
shikharvaish28 commented
Hi,
I am trying to run it but it's throwing this error:
Traceback (most recent call last):
File "/Users/shikhar/Downloads/pheonix_project/autoCDSL/gmail.py", line 3, in <module>
from googleapiclient.discovery import build
ModuleNotFoundError: No module named 'googleapiclient'
Setup:
Python 3.9
I have run the command in the doc
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
(Pheonix) shikhar@Shikhars-MacBook-Pro autoCDSL % pip3 install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Requirement already satisfied: google-api-python-client in /opt/homebrew/lib/python3.9/site-packages (2.70.0)
Requirement already satisfied: google-auth-httplib2 in /opt/homebrew/lib/python3.9/site-packages (0.1.0)
Requirement already satisfied: google-auth-oauthlib in /opt/homebrew/lib/python3.9/site-packages (0.8.0)
Requirement already satisfied: google-auth<3.0.0dev,>=1.19.0 in /opt/homebrew/lib/python3.9/site-packages (from google-api-python-client) (2.15.0)
Requirement already satisfied: google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5 in /opt/homebrew/lib/python3.9/site-packages (from google-api-python-client) (2.11.0)
Requirement already satisfied: httplib2<1dev,>=0.15.0 in /opt/homebrew/lib/python3.9/site-packages (from google-api-python-client) (0.20.4)
Requirement already satisfied: uritemplate<5,>=3.0.1 in /opt/homebrew/lib/python3.9/site-packages (from google-api-python-client) (4.1.1)
Requirement already satisfied: six in /opt/homebrew/lib/python3.9/site-packages (from google-auth-httplib2) (1.16.0)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /opt/homebrew/lib/python3.9/site-packages (from google-auth-oauthlib) (1.3.1)
Requirement already satisfied: googleapis-common-protos<2.0dev,>=1.56.2 in /opt/homebrew/lib/python3.9/site-packages (from google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-api-python-client) (1.56.4)
Requirement already satisfied: requests<3.0.0dev,>=2.18.0 in /opt/homebrew/lib/python3.9/site-packages (from google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-api-python-client) (2.26.0)
Requirement already satisfied: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5 in /opt/homebrew/lib/python3.9/site-packages (from google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-api-python-client) (4.21.12)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /opt/homebrew/lib/python3.9/site-packages (from google-auth<3.0.0dev,>=1.19.0->google-api-python-client) (0.2.8)
Requirement already satisfied: cachetools<6.0,>=2.0.0 in /opt/homebrew/lib/python3.9/site-packages (from google-auth<3.0.0dev,>=1.19.0->google-api-python-client) (5.0.0)
Requirement already satisfied: rsa<5,>=3.1.4 in /opt/homebrew/lib/python3.9/site-packages (from google-auth<3.0.0dev,>=1.19.0->google-api-python-client) (4.9)
Requirement already satisfied: pyparsing!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3,<4,>=2.4.2 in /opt/homebrew/lib/python3.9/site-packages (from httplib2<1dev,>=0.15.0->google-api-python-client) (3.0.6)
Requirement already satisfied: oauthlib>=3.0.0 in /opt/homebrew/lib/python3.9/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib) (3.2.2)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /opt/homebrew/lib/python3.9/site-packages (from pyasn1-modules>=0.2.1->google-auth<3.0.0dev,>=1.19.0->google-api-python-client) (0.4.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in /opt/homebrew/lib/python3.9/site-packages (from requests<3.0.0dev,>=2.18.0->google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-api-python-client) (2.0.9)
Requirement already satisfied: idna<4,>=2.5 in /opt/homebrew/lib/python3.9/site-packages (from requests<3.0.0dev,>=2.18.0->google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-api-python-client) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/homebrew/lib/python3.9/site-packages (from requests<3.0.0dev,>=2.18.0->google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-api-python-client) (1.26.7)
Requirement already satisfied: certifi>=2017.4.17 in /opt/homebrew/lib/python3.9/site-packages (from requests<3.0.0dev,>=2.18.0->google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-api-python-client) (2022.6.15)
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
shikharvaish28 commented
Tried it with pip3
as well.
CasCard commented
Are you using conda virtual environment?, If yes
- you can either deactivate it and use the default system default python, interpreter
- if you would like to use conda , you can use the
conda
command to install packages - if you would like to use python virtual environment you can install using pip3 as well
shikharvaish28 commented
No, I am not using conda
I have tried using pip3.
- You're using python2?
- Can you please upload your
requirements.txt
file? We'll be able to install the dependencies from there easily - I am trying to run this locally first assuming it should not be an issue. Is there different setting to run it locally?
CasCard commented
I have attached the requirements txt file.
shikharvaish28 commented
This worked! Thanks!
shikharvaish28 commented
On a side note @CasCard: Do we need to refresh the google access token every day?
CasCard commented
I am not sure about the exact lifetime, but since the google cloud Gmail application API in "Publishing status" it should have unlimited validity / one year . I haven't personally experienced expiration since time I have been using it.