When installing packages from PyPI, you have to use the name of the project, which is different from the name of the top-level packages which you will actually import. A clear example is pyserial and serial, which get installed using:
pip install serial
pip install pyserial
But both are used with something like:
import serial
If you explore the site-packages
folder, you see that the contents are the combination of both packages, and, of course, the files get overwritten by the latest to be installed, giving unpredictable results.
Is there a way of avoiding this kind of name clashes when installing packages in Python? Imagine you would like to use both pyserial and serial, how would you then install them?