Open ylnhari opened 2 years ago
i am facing the same issue. Any solution so far?
I was having this issue for a few days but fixed it by creating a new environment with older versions of the packages I needed, so ylnhari's suspicion that there might be some conflict with package versions seems to be on the money. Since I'm working through a class that wants us to have everything installed with Anaconda my environment isn't super custom, but it worked when I downgraded from the most up-to-date version to anaconda=5.3.0.
For a more general approach my intuition is to target the packages that are specifically referred to in gmaps's requirements.txt (six, ipython>=5.3.0, ipywidgets>=7.0.0, traitlets>=4.3.0, geojson>=2.0.0). I'm afraid I'm far too much of a novice to walk through building only what might be necessary into an environment, so I hope this is enough of a jumping off point for people who want to avoid installing bloat. However if anyone running into this issue wants a quick and dirty solution and isn't too picky about what gets added to the environment, here's what I did:
python -m ipykernel install --user --name myenv --display-name "Python (myenv)"
$ jupyter nbextension enable --py --sys-prefix gmaps
to load it.This is just a workaround I think if the current versions of one the gmaps requirements is causing conflicts. I went down a few rabbit holes looking into the errors that get logged to the console and came back with a potential issue with the JS compilier Babel's config. How, where and why that is now getting picked up with updates to python packages is not something I can even guess at let alone attempt to fix, but hopefully this workaround helps for people just looking for things to work!
@arooj1 , I tried running the same on my other workstation with Linux environment whose environment was untouched and it is working fine there ,now I strongly believe that this is due to some requirements libraries of g-maps that could be creating these issues try @sbenston solution let us know your experience.
I fixed this in a development install by updating babel
( https://github.com/babel/babel-upgrade). The issue seems to be that webpack
uses babel
to transpile the JavaScript so that it works in older browsers. However, the default version, configured in js/.babelrc
and described in js/package.json
doesn't do this properly for ES6.
Thanks @timcoote .
After spending 7 hours on it, I finally found a way. I made a docker file that solves the problem:
FROM python:3.9.10-buster
MAINTAINER Philippe Remy <premy.enseirb@gmail.com>
EXPOSE 8888
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update
# Install specific version of node/npm
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
# Install gmaps
RUN pip install pip --upgrade
RUN pip install jupyter
WORKDIR /gmaps
RUN apt-get install git && git clone https://github.com/pbugnion/gmaps.git .
WORKDIR /gmaps/js
RUN npx babel-upgrade --write
RUN npm update
WORKDIR /gmaps
RUN bash ./dev-install
ENTRYPOINT [ "jupyter-notebook", "--ip", "0.0.0.0", "--port", "8888", "--allow-root", "." ]
did anybody find here solution to using python3.8 on a virtual environment without conda and without source installation
@tejalbarnwal it's not possible. You need to use the source installation.
Issue:
I was able to successfully create gmaps figure object but when tried to display the map in a jupyter cell, receiving the following error ->
It was working fine until few weeks ago. I tried re-installing jupyter-gmaps and enabling the gmaps jupyter extension, created fresh virtual environment, tried reinstalling node.js, reinstalling jupyter etc. but got no luck. I suspect some package version issues could be a reason for this as this setup is working fine until few weeks ago please help.
Note:- also ipywidgets should not be the issue because i was able to create widgets using it and they are working fine in the same jupyter notebook.
Input code used to generate a figure :
Requirements file:
python=3.7.0 tqdm pandas openpyxl xlrd requests ortools jupyter gmaps
Screen shot of the error: