Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy
 

How to install mapnik via python pip




mapnik - Python bindings for Mapnik, it belongs to Classifiers:

- License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
- Operating System :: MacOS :: MacOS 9
- Operating System :: MacOS :: MacOS X
- Programming Language :: C
- Programming Language :: C++
- Topic :: Scientific/Engineering :: GIS

When you know about this project and you want to new install mapnik to support your project or you get trouble as ModuleNotFoundError: No module named "mapnik" or ImportError: cannot import name "mapnik" in your project, let follow this tutorial to install mapnik



Installation:

Step 1: First, ensure you installed pip in your os, to check pip has been installed on your computer

In Windows (CMD):

py -m pip --version

In Unix/macOS:

python3 -m pip --version

Ensure pip, setuptools, and wheel are up to date:

In Windows (CMD):

py -m pip install --upgrade pip setuptools wheel

In Unix/macOS:

python3 -m pip install --upgrade pip setuptools wheel


Optional - If you want to install in virtual environment:

In Windows (CMD):

- Install virtualenv - if you installed it, please ignore

py -m pip install --user virtualenv

- Create a virtual environment

py -m venv test_mapnik_env

- Active the virtual environment

test_mapnik_env\Scripts\active

In Unix/macOS:

- Install virtualenv - if you installed it, please ignore

pip3 install virtualenv

- Create a virtual environment

python3 -m venv test_mapnik_env

- Active the virtual environment

source test_mapnik_env/bin/active


Step 2: OK, now, let flow below content to start the installation mapnik

To install mapnik on Windows(CMD):

py -m pip install mapnik

To install mapnik on Unix/macOs:

pip install mapnik


Step 3: If you want to install a specific mapnik version, add ==<mapnik version> to the end command line

Example:

pip install mapnik==0.0.0


Please see the version list below table:

VersionReleased dateCommand
mapnik 0.12015-05-04T21:12:42Windows:

py -m pip install mapnik==0.1

Unix/macOs:

pip install mapnik==0.1

mapnik 0.0.02012-09-01T14:00:01Windows:

py -m pip install mapnik==0.0.0

Unix/macOs:

pip install mapnik==0.0.0


Step 4: Otherwise, you can install mapnik from local archives:

Download the distribution file from mapnik-0.1-py2.7-macosx-10.6-intel.egg or the specific mapnik version in the below list of distribution

After that, install by command:

On Windows(CMD):

py -m pip install <path_to_mapnik_downloaded_file>

On Unix/macOs:

pip install <path_to_mapnik_downloaded_file>


List distribution:

- mapnik-0.1-cp27-none-any.whl
- mapnik-0.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
- mapnik-0.1-py2.7-linux-x86_64.egg
- mapnik-0.1-py2.7-macosx-10.6-intel.egg


Project link:

- Homepage