-1

I'm trying to show a map where each customer distribution or location while doing so the map won't appear in jupyter notebook the problem maybe within the browser so I used different browsers like chrome, opera and brave.while trying the same code in a collab notebook the code runs. Even the simple world map won't appear.

This image for the code and where the output should appear in the notebook

  • That behavior you are seeing with a blank area and no message, yet no displayed plot is usually characteristic of a complex install having taken place in your environment but there issues still to work out. Sometimes you aren't using the exact Jupyter interface it expects (class notebook vs. JupyterLab). Sometimes you need a thorough restart of everything to propagate the changes. Was it working before, and now not working? Such details and actual code should be in the post. You did say you tried different browsers. Colab works because it includes somethings by default with need for install. – Wayne Aug 14 '23 at 14:17
  • If it would help to see folium working for comparison, go to [the main JupyterLite page](https://jupyterlite.readthedocs.io/en/latest/) and click the orange 'Lab' button in the the upper left corner. When that opens on your machine, use the file browser on the left side panel navigate into the directory '`pyodide`'. You'll see listed there a notebook named '`folium.ipynb`'. (It may be third from the top.) You can double click that to open it and then choose from along the File menu, '`Run`' > '`Run All Cells`'. Pandas ... – Wayne Aug 14 '23 at 16:16
  • is installed as well and so you can drag-and-drop your data file and your `.ipynb` file from your local machine into the 'system' running inside your browser. And then run your notebook there. If you make anything useful, be sure to download it back to your actual local drive. That JupyterLite session is running inside a system inside your browser and if the browser cache gets cleared for any reason, your progress and notebooks will be lost otherwise. I would have suggested using MyBinder to compare but launch attemprs from there right now are very hit-or-miss, mostly miss for now. – Wayne Aug 14 '23 at 16:19
  • The difference is that MyBinder sessions would have full **typical** Python kernels and can install many more packages than you presently can in JupyterLite, which is running a web assembly-based version of the kernel, which while it keeps getting better still has some quirks now and then. – Wayne Aug 14 '23 at 16:21
  • @Wayne No it wasn't working before from the beginning the code wasn't working on and yes I have installed foluim in the juptyer notebook well 'python' – Marwan Ashraf Aug 20 '23 at 10:31
  • 'code' !pip install folium this is the line of code I used to install folium map = folium.Map(location= [df_location.Lat.mean(), df_location.lon.mean()], zoom_start=14, control_scale=True) map this is the lines I used for folium also I'm sorry that my question isn't well clarified this is my first question to ask on StackOverflow – Marwan Ashraf Aug 20 '23 at 10:35
  • Does the import of folium work without error? For best experience and proper installation, you should be using `%pip install folium` in modern Jupyter (not Google Collab) and not the exclamation point version. The exclamation point doesn't necessarily direct the install to the proper location depending on how you installed Jupyter, see both my comments [here](https://stackoverflow.com/questions/69149501/cannot-import-name-flowercommand-from-flower-command/76932284#comment135623093_76932284) for references about that. – Wayne Aug 20 '23 at 12:34
  • And your post still isn't clear. " No it wasn't working before from the beginning the code wasn't working on", is not clear. I'd guess since it is making the space to put the map most of the things are correct. It just isn't communicating properly on your system. Try JupyterLite as a I recommended because foilum is properly installed there. Or try installing [the Anaconda distribution](https://docs.anaconda.com/free/anaconda/index.html) and then read how to install stuff in the Anaconda install using `conda install -c conda-forge folium`. – Wayne Aug 20 '23 at 12:39
  • I apologize for the confusion. To clarify, the code that was not working on Jupyter Notebook initially, but was functional on Google Colab, is now working correctly after I installed the Anaconda distribution. I appreciate your assistance, and in the future, I will make sure to provide clearer questions. Thank you for your time. – Marwan Ashraf Aug 20 '23 at 14:28
  • Glad to hear installing the Anaconda Distribution fixed things? Did you have to run that `conda install` command as well? – Wayne Aug 21 '23 at 12:16
  • Yes,I had to run `conda install` – Marwan Ashraf Aug 22 '23 at 06:50
  • Thanks for adding that information; it may help somebody with a similar situation. – Wayne Aug 22 '23 at 12:23

0 Answers0