Usage of PYTHONPATH

That is the mistake. You installed the package as a certain user but you run your Python program as a different user or with a different environment. Do not use PYTHONPATH to fix the mistake.


It would be probably best if you install the packages you need into a venv:

A venv is a directory which contains all the packages you use in the context of the venv (isolated from other packages). To execute python programs using a venv you have basically two options:
a) activate the venv first or, then execute the Python programs as usual (but within the venv)
b) call the programs using the python executable inside the venv.

For example if the venv directory is directory/my_venv then the two options are:
a) source directory/my_venv/bin/activate (or a slightly different Windows variant in the doc)
b) directory/my_venv/bin/python your_program.py