Cannot Import MousePosition from folium.plugins - folium

I can't Import MousePosition from folium.plugins. I am having the below error when I execute these codes. How should I go about it?
Thank you.

Install specific version of folium i.e. 0.7
Below command:
pip install folium==0.7.0
And then restart Kernel
Hopefully this will be resolve your issue!

It's horrible, I've been straggling with it myself for weeks.
It only works on Python3 Jupyter notebooks run on the web. Try loading the lab notebook on https://jupyter.org/ in your browser (I use chrome).
Once the kernel dies and restarts however, it will failed to load again. You'll have to close the tab and re-launch the binder all over again.
It won't load on Anaconda kernels either.

Try using Google Colab, it worked for me there.

Related

Import "[module]" could not be resolved Pylance (reportMissingImports) in my Jupyter notebook while trying to run code on VS Code

I am trying to do an END-to-END project for BostonHousing on VS Code. I have installed the requirements already from requirements.txt and also chose the Python interpreter as that of my virtual environment version still the error pops like below for Jupyter notebook. The flask file is fine. Please guide me on what's wrong here.
enter link description here
you may got your answer here.check and read carefully.
Import "[module]" could not be resolvedPylance (reportMissingImports)

Jupyter Notebook Kernel dies when importing tenserflow

I am using Macbook Air with M1 chip. When trying to import tensorflow in Jupyter notebook, the kernel dies and displays a prompt that "Kernel has died and will restart in sometime". Could someone help me fix this?
Tensorflow version - 2.5.0
Python version - 3.8.8
Try running the notebook file within VS Code, there are extensions to help with that. Also check this article on how to install tf on M1 https://towardsdatascience.com/installing-tensorflow-on-the-m1-mac-410bb36b776
It seems this is a recurring issue with multiple people with the m1 macs. Since it is still fairly new, it is possible that Jupiter notebook still doesn't fully support it. Try using anaconda navigator with the windows emulator. Here is a link to a forum post with people having the same problem.
https://github.com/apple/tensorflow_macos/issues/45
Anaconda and upgrading to new M1 Mac

Code formatter like nb_black for google colab

I know that for jupyter notebooks and jupyter lab, there are available code formatter extensions such as nb_blackor blackcellmagic. However when I installed them, it doesn't seem to work on google colab.
Do you know if there are any native option in colab or an extension that formats code (pep8 compliant)?
I don't think there's an extension directly in Colab.
What you could do, though, is to download your notebook, run
pip install -U nbqa
nbqa black notebook.ipynb
and then reupload your (now formatted) notebook to Colab
disclaimer: I'm the author of nbQA
UPDATE: as of version 21.8b0, black runs directly on notebooks, no third-party tool required
I have tried everything, none of the JupyterLab/Notebook backend hack methods seem to work as of February 2022. However, until later here is a relatively simple workaround:
[Run only once, at startup]
Connect to your drive
from google.colab import drive
drive.mount("/content/drive")
Install black for jupyter
!pip install black[jupyter]
Restart kernel
[Then]
Place your .ipynb file somewhere on your drive
Anytime you want format your code run:
!black /content/drive/MyDrive/YOUR_PATH/YOUR_NOTEBOOK.ipynb
Don't save your notebook, hit F5 to refresh the page
Voila!
Now save!

haveing problem getting importing tensroflow in jupyter and sypder from anaconda installation

To start out I had a anaconda installation with python 3.5.2. After doing a pip tensorflow installation I got an error something like "nosetest...". I searched stackoverflow and got a suggestion to move to python 3.6.
So I uninstalled the whole of anaconda and python. Then did complete fresh install of anaconda with python 3.6.10. Did a pip install of tensforflow. launched spyder and jupyter and could not import tensorflow. However, when I issue commands from python command prompt things work fine.
So can't seem to get tensorflow to import in spypder or jupyter.
Lastly following another suggest I ran the c:/from/my/anaconda/Scripts/activate base. But that also didn't work in spyder. However in jupyter it seemed to import but then crashed on tf.version
with access violation.
Can you please help, I've tried many things and suggestions, can't seem to get tensorflow to work with python 3.5 or 3.6.
Thanks.
P.S. I remember using python3.5.2 sometime ago with the then tensorflow, I think version 1.1x and everything went smoothly, everything installed and imported worked beautifully.

Can't run Tensorflow on GPU within jupyter-notebook

I can't be able to run the tensorflow code with GPU when I ran it from a jupyter notebook. Same code runs no problem, if I ran in a python script.
I followed the main installation link:
https://www.tensorflow.org/install/install_windows
Also tried:
http://bailiwick.io/2017/11/05/tensorflow-gpu-windows-and-jupyter/
No problems outside notebook when I ran in a python script file.
Most likely the problem is similar to this:
Tensorflow not running on GPU in jupyter notebook
More specifically my test:
I can see both devices CPU and GPU via python a script
I can see only CPU via notebook
Thanks a lot for any help in advance!
Very late, but short answer:
Here is a Tutorial on how to set up a GPU-based Jupyterlab instance with Docker (which makes the installation faster).
I hope this helps!
I removed all existing environments and created a new one, which resolved the issue.
(Also, I had to apply the following to get around an issue caused by removed environments:
https://github.com/jupyter/notebook/issues/2301
)