I’m trying to import the google maps module and although I’ve installed it already when I run my code it as if it can’t find it on my mac?
I’ve installed the following from google just to be safe but I still get the error further below?
pip list -v
google 3.0.0 /opt/anaconda3/lib/python3.11/site-packages pip
google-api-core 2.19.1 /opt/anaconda3/lib/python3.11/site-packages pip
google-api-python-client 2.136.0 /opt/anaconda3/lib/python3.11/site-packages pip
google-auth 2.31.0 /opt/anaconda3/lib/python3.11/site-packages pip
google-auth-httplib2 0.2.0 /opt/anaconda3/lib/python3.11/site-packages pip
googleapis-common-protos 1.63.2 /opt/anaconda3/lib/python3.11/site-packages pip
googlemaps 4.10.0 /opt/anaconda3/lib/python3.11/site-packages pip
!pip install googlemaps #did this just to be sure, but didn't help
import googlemaps
import pandas as pd
# Initialize the Google Maps client with your API key
API_KEY = '' # Replace with your actual API key
gmaps = Client(key=API_KEY)
# Define the location and the search term
location = 'Hudson Valley, NY'
search_term = 'restaurants'
Then I get the following error from JupyterLab
[ModuleNotFoundError Traceback (most recent call last)
Cell In[17], line 2
1 get_ipython().system('pip install googlemaps')
----> 2 from googlemaps import Client
3 import pandas as pd
5 # Initialize the Google Maps client with your API key
ModuleNotFoundError: No module named 'googlemaps'](https://stackoverflow.com)
Andrew Carson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.