Inconsistency in Python library names

It is well known (or perhaps not) that some Python packages have seemingly inconsistent names. Keeping this in mind might save you a lot of unnecessary debugging headaches.

For example, the package multiprocessing can speed up certain tasks by parallelism. It is imported as follows.

import multiprocessing

Meanwhile, a nonsensical error would occur if you try to use pip install multiprocessing for actually installing said package. It turns out the installation should be:

pip install multiprocess

Such inconsistency in Python package naming is not uncommon, as discussed in this Stack Overflow question (link). The short answer is: multiprocessing is the Python package/module name (which we usually use), while multiprocess is how the package manager, pip in this case, likes to call it.


You'll only receive email when they publish something new.

More from Spark Tseung
All posts