Last modified: Oct 06, 2026

Install Folium in Python: Easy Step-by-Step Guide

Folium is a powerful Python library for creating interactive maps. It combines Python's data capabilities with the Leaflet.js mapping library.

This guide shows you exactly how to install Folium and get started with map creation. You will also learn to fix common installation problems.

Prerequisites

Before installing Folium, make sure you have Python 3.6 or higher on your system. You can check your version by running this command in your terminal.

python --version

If you see an error, download Python from the official website first. You should also have pip, the Python package manager, ready to use.

It is a good practice to create a virtual environment for your projects. This keeps your dependencies isolated and avoids conflicts.

Install Folium with pip

The simplest way to install Folium is using pip. Open your terminal or command prompt and run this command.

pip install folium

This command downloads and installs the latest version of Folium. It also automatically installs all required dependencies.

If you are using a virtual environment, make sure it is activated first. Then run the pip command inside that environment.

For some systems, you may need to use pip3 instead of pip to target Python 3.

pip3 install folium

Install Folium with conda

If you use Anaconda or Miniconda, you can install Folium through the conda package manager. This method is often more reliable for data science environments.

conda install -c conda-forge folium

The conda-forge channel provides the most up-to-date Folium package. This command handles all dependency resolution automatically.

Using conda is recommended if you already manage your Python environment with Anaconda. It avoids mixing pip and conda packages unnecessarily.

Folium Dependencies

Folium depends on several other Python libraries. When you install Folium, these are installed automatically.

  • Branca — handles non-map-specific features like color scales.
  • Jinja2 — templating engine used to generate the HTML output.
  • Numpy — provides numerical computing support for coordinate data.
  • Requests — manages HTTP requests for map tiles and data.

You do not need to install these manually. The pip or conda command takes care of everything.

Additional packages may be needed for certain Folium features. The official documentation notes these requirements where relevant.

Verify the Installation

After installation, verify that Folium is working correctly. Open a Python interpreter or create a new Python file and run this import statement.

import folium # Check the installed version print(folium.__version__)

If you see a version number printed, the installation was successful. If you get a ModuleNotFoundError, Folium is not installed in the correct Python environment.

You can also check where Folium is installed on your system.

import folium print(folium.__file__)

This shows the exact path to the Folium package. It helps confirm that the right Python interpreter is using the correct installation.

Quick Example: Create Your First Map

Now that Folium is installed, let's create a simple interactive map. This example shows a map centered on a specific location.

import folium # Create a map centered on New York City m = folium.Map(location=[40.7128, -74.0060], zoom_start=12) # Save the map as an HTML file m.save("my_map.html") print("Map created successfully!")

When you run this code, it creates an HTML file called my_map.html. Open this file in any web browser to see your interactive map.

Map created successfully!

You can change the location coordinates to center the map anywhere in the world. The zoom_start parameter controls the initial zoom level.

In a Jupyter Notebook, you can display the map directly without saving it. Just type the variable name m as the last line in a cell.

m

Troubleshooting Common Issues

Most installation problems come from using the wrong Python environment. Here are the most common issues and how to fix them.

ModuleNotFoundError After Installation

This error means Folium was installed in a different Python environment than the one you are using. Use python -m pip install folium to target the correct interpreter.

python -m pip install folium

You can also check which Python version pip is using with pip --version. Make sure it matches the Python version you run your scripts with.

Permission Errors

On some systems, pip may fail due to permission restrictions. Installing for your user account only solves this problem.

pip install --user folium

This installs Folium in your user directory without requiring administrator access. It is a safe alternative to using sudo.

Version Conflicts

If you encounter conflicts with other libraries, try installing a specific version of Folium. You can also upgrade all packages with pip install --upgrade folium.

pip install folium==0.17.0

Using a virtual environment is the best way to avoid version conflicts. Create one for each project that uses Folium.

Importing Folium Plugins

Folium plugins require a separate import statement. If you see an error about folium.plugins, add this line to your code.

import folium import folium.plugins

This gives you access to features like HeatMap, MarkerCluster, and Fullscreen. The base folium import does not include these by default.

Conclusion

Installing Folium in Python takes just one command. Use pip install folium or conda install -c conda-forge folium and you are ready to build interactive maps.

Always verify the installation by importing the library. If you hit errors, check your Python environment and try the troubleshooting steps above.

With Folium installed, you can create maps, add markers, and visualize geographic data. Start with a simple map and gradually explore the library's many features.