Search code examples
pythonpytz

I have installed pytz via pip but "import pytz" throws a module not found exception


I installed pytz on Debian Buster via

sudo pip install pytz

and the install completed cleanly. However, when I attempt to

import pytz

python throws an exception

    import pytz
ModuleNotFoundError: No module named 'pytz'

I installed pytz 2019.3 via pip 18.1. Any thoughts on why pytz is not found?

Update: I ran pip -v and now see that it is using python2.7. Is there a way to tell pip to use python3? I cannot remove python2 as it is a dependency for a number of packages.


Solution

  • Use pip3 to install modules for python3