Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading gmaps: AttributeError: module 'gmaps' has no attribute 'configure' #267

Closed
ianweb1000 opened this issue Sep 23, 2018 · 9 comments

Comments

@ianweb1000
Copy link

Has anyone experience this issue:

AttributeError Traceback (most recent call last)
in ()
1 import gmaps
----> 2 gmaps.configure(api_key='AIzaSyBJrDxxxxxxxxxxxxxxxxxx')

AttributeError: module 'gmaps' has no attribute 'configure'

@pbugnion
Copy link
Owner

pbugnion commented Sep 23, 2018

Thanks for raising this. It'd help to know the answers to the following?

  1. How did you install gmaps? With pip or conda?
  2. What does running gmaps.__version__ in Jupyter show?
  3. What does running pip list | grep maps in the terminal show?

@pbugnion pbugnion changed the title configure and figure , issues with gmaps Error loading gmaps: AttributeError: module 'gmaps' has no attribute 'configure' Sep 23, 2018
@ianweb1000
Copy link
Author

ianweb1000 commented Sep 23, 2018 via email

@pbugnion
Copy link
Owner

It looks like you've installed this package, not jupyter-gmaps. Which one were you trying to install?

This package is for visualizing data on Google maps in Jupyter notebooks, whereas python-gmaps, the one you actually installed, is for querying the Google Maps APIs (e.g. for geocoding).

To make sure you've installed this package:

pip uninstall python-gmaps
pip install gmaps
jupyter nbextension enable --py --sys-prefix gmaps

... then restart any open Jupyter server and close the browser tabs.

To check that you're on the right package:

gmaps.__version__

should show 0.8.0.

@ianweb1000
Copy link
Author

ianweb1000 commented Sep 24, 2018 via email

@pbugnion
Copy link
Owner

how about on the conda enviroment?

It's the same thing -- you have two modules with the same package name (both this package and python-gmaps use gmaps as the package name, though I note that this repository predates the other one), so when conda runs jupyter nbextension ..., it finds the wrong package.

@ianweb1000
Copy link
Author

ianweb1000 commented Sep 25, 2018 via email

@Nelooma
Copy link

Nelooma commented Nov 24, 2019

found this thread and I wonder if anyone can help me, I am working with a jypternotebook.

Installed the package with pip but I get a long error message when I run

! jupyter nbextension enable --py gmap

See error message below.

Exception while loading config file /var/pod/.runtime/ax-ext/config/wscloud/jupyter_notebook_config.py
Traceback (most recent call last):
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/traitlets/config/application.py", line 562, in _load_config_files
config = loader.load_config()
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/traitlets/config/loader.py", line 457, in load_config
self._read_file_as_dict()
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/traitlets/config/loader.py", line 489, in _read_file_as_dict
py3compat.execfile(conf_filename, namespace)
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/ipython_genutils/py3compat.py", line 198, in execfile
exec(compiler(f.read(), fname, 'exec'), glob, loc)
File "/var/pod/.runtime/ax-ext/config/wscloud/jupyter_notebook_config.py", line 17, in
from cdsax_jupyter_extensions.ax_log import ax_log_request
ModuleNotFoundError: No module named 'cdsax_jupyter_extensions'
Enabling notebook extension jupyter-gmaps/extension...
Traceback (most recent call last):
File "/opt/conda/envs/Python36/bin/jupyter-nbextension", line 11, in
sys.exit(main())
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/notebook/nbextensions.py", line 988, in start
super(NBExtensionApp, self).start()
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/jupyter_core/application.py", line 255, in start
self.subapp.start()
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/notebook/nbextensions.py", line 896, in start
self.toggle_nbextension_python(self.extra_args[0])
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/notebook/nbextensions.py", line 872, in toggle_nbextension_python
logger=self.log)
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/notebook/nbextensions.py", line 483, in enable_nbextension_python
logger=logger)
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/notebook/nbextensions.py", line 386, in _set_nbextension_state_python
for nbext in nbexts]
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/notebook/nbextensions.py", line 386, in
for nbext in nbexts]
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/notebook/nbextensions.py", line 351, in _set_nbextension_state
cm.update(section, {"load_extensions": {require: state}})
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/notebook/config_manager.py", line 136, in update
self.set(section_name, data)
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/notebook/config_manager.py", line 110, in set
self.ensure_config_dir_exists()
File "/opt/conda/envs/Python36/lib/python3.6/site-packages/notebook/config_manager.py", line 67, in ensure_config_dir_exists
os.makedirs(self.config_dir, 0o755)
File "/opt/conda/envs/Python36/lib/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/var/pod/.runtime/ax-ext/config/wscloud/nbconfig'
In [14]:

@Nelooma
Copy link

Nelooma commented Nov 24, 2019

Please see the code below

import gmaps
import gmaps.datasets
import ipywidgets as widgets
import geopy

API_KEY = " AI***"
gmaps.configure(api_key = API_KEY )

m = gmaps.Map()
m

No error message but map does not display.
Output below:

Map(configuration={'api_key': ' AI*** '}, data_bounds=[(46.2, 6.1), (47.2, 7…

@huzbat
Copy link

huzbat commented Aug 25, 2022

I am having this issue:
gmaps installed. But this error message keeps coming up.
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants