1

I have a DevOps script that upgrade the build / version numbers in my project. It uses lxml library to parse xml type files. It was working great but all of a sudden, I got the error : ModuleNotFoundError: No module named 'lxml'. I already tried updating lxml, and uninstall / reinstall but none of those worked. I also tried it with python 2.7 but got the exact same error.

I am using python3 and pip3 with aliases as following :

❯ which python
python: aliased to /usr/local/bin/python3
❯ which pip
pip: aliased to /usr/local/bin/pip3

macos Catalina 10.15.6 (19G2021)

lxml version : 4.5.2

python 3.8.5

pip 20.2.3

BenjaminB
  • 53
  • 6

1 Answers1

0

OK I managed to understand what is going on thanks to @Georges Martin. The issue was that pip was installing into /usr/local/lib/python3.9/site-packages but my python3 was actually pointing to /usr/local/Cellar/python@3.8/3.8.5/bin/python3.8 and not python3.9.

BenjaminB
  • 53
  • 6