I wanted to experiment with connecting to Google Calendar APIs with a service account.
The example code requires google.oauth2
, which for some reason I cannot import:
C:\Users\yop>pip3 install google
Requirement already satisfied: google in c:\users\yop\appdata\local\programs\python\python37-32\lib\site-packages (2.0.3)
Requirement already satisfied: beautifulsoup4 in c:\users\yop\appdata\local\programs\python\python37-32\lib\site-packages (from google) (4.8.2)
Requirement already satisfied: soupsieve>=1.2 in c:\users\yop\appdata\local\programs\python\python37-32\lib\site-packages (from beautifulsoup4->google) (1.9.5)
C:\Users\yop>python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import google
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'google'
How can I troubleshoot this? The module seems to be installed, for the right Python version.
In contrast, consider the arrow
module, which is installed the same way:
C:\Users\yop>pip3 install arrow
Requirement already satisfied: arrow in c:\users\yop\appdata\local\programs\python\python37-32\lib\site-packages (0.11.0)
Requirement already satisfied: python-dateutil in c:\users\yop\appdata\local\programs\python\python37-32\lib\site-packages (from arrow) (2.8.0)
Requirement already satisfied: six>=1.5 in c:\users\yop\appdata\local\programs\python\python37-32\lib\site-packages (from python-dateutil->arrow) (1.12.0)
C:\Users\yop>python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
>>> arrow.__file__
'C:\\Users\\yop\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\arrow\\__init__.py'
The modules to install in order to import google
are google-auth
and google-auth-oauthlib
:
pip3 install google-auth google-auth-oauthlib
After that you will be able to import google.oauth2