No folium module after pip install"

I got this error:

NameError: name 'List' is not defined

I am getting a NameError when trying to run the code below.

import pandas as pd
import folium
from geopy.geocoders import ArcGIS

#data frame
snifim_df = pd.read_csv('Snif.csv')
nom = ArcGIS()

snifim_df['LAT'] = snifim_df['Address'].apply(nom.geocode,timeout=15).apply(lambda x:x.latitude)
snifim_df['LON'] = snifim_df['Address'].apply(nom.geocode,timeout=15).apply(lambda x:x.longitude)

Mcmap = folium.Map(location=[32.58, -99.09], zoom_start = 6)
fg = folium.FeatureGroup(name = "McDonalds")

snif_lat = list(snifim_df['LAT'])
snif_lon = list(snifim_df['LON'])
snif_name = list(snifim_df['Name'])
snif_address = list(snifim_df['Address'])

html = """  <h4>Mcdonalds</h4>
            Snif_Adress: %s

"""

for lat,lon,name,add in zip(snif_lat,snif_lon,snif_name,snif_address):
    iframe = folium.Iframe(html = html % str(add),width=200, height=100)
    fg.add_child(folium.Marker(location=[lat,lon],popup=folium.Popup(iframe),icon="glyphicon glyphicon-piggy-bank"))


Mcmap.add_child(fg)
Mcmap.save("test.html")

After I had already installed Folium with pip install folium, the code worked, but suddenly I started getting the following error:

NameError: name 'List' is not defined

The code I am running is included below.

import pandas as pd
import folium
from geopy.geocoders import ArcGIS

#data frame
snifim_df = pd.read_csv('Snif.csv')
nom = ArcGIS()

snifim_df['LAT'] = snifim_df['Address'].apply(nom.geocode,timeout=15).apply(lambda x:x.latitude)
snifim_df['LON'] = snifim_df['Address'].apply(nom.geocode,timeout=15).apply(lambda x:x.longitude)

Mcmap = folium.Map(location=[32.58, -99.09], zoom_start = 6)
fg = folium.FeatureGroup(name = "McDonalds")

snif_lat = list(snifim_df['LAT'])
snif_lon = list(snifim_df['LON'])
snif_name = list(snifim_df['Name'])
snif_address = list(snifim_df['Address'])

html = """  <h4>Mcdonalds</h4>
            Snif_Adress: %s

"""

for lat,lon,name,add in zip(snif_lat,snif_lon,snif_name,snif_address):
    iframe = folium.Iframe(html = html % str(add),width=200, height=100)
    fg.add_child(folium.Marker(location=[lat,lon],popup=folium.Popup(iframe),icon="glyphicon glyphicon-piggy-bank"))


Mcmap.add_child(fg)
Mcmap.save("test.html")

After I had already installed Folium with pip install folium, I started getting a NameError when running the code above. The error message was: NameError: name 'List' is not defined.

The error NameError: name 'List' is not defined is most likely caused by a missing import statement for the List type hint. To fix this issue, add the following import statement at the top of your code:

from typing import List

This should resolve the NameError and allow your code to run without any issues.