Can't immediately import a module installed on script when using the pip --prefix option

import subprocess
import sys

sys.path.append("/home/user/python_install/lib/python3.6/site-packages")

try:
  from pytz import reference
except:
  subprocess.call([sys.executable, "-m", "pip", "install", 'pytz', "--prefix=python_install"])
  from pytz import reference

In the above code snippet, if initial import fails I want to install the module in a local folder and retry the import.

The issue that I'm facing is that the import (after installation) is not working in the 1st run of the script:

Installing collected packages: pytz
Successfully installed pytz-2021.1
Traceback (most recent call last):
  File "timezone_test2.py", line 17, in <module>
    from pytz import reference
ModuleNotFoundError: No module named 'pytz'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "timezone_test2.py", line 20, in <module>
    from pytz import reference
ModuleNotFoundError: No module named 'pytz'

On the next runs of the script the module is imported without any issue. Already validated that sys.path is correct, and pip installs the module in the right place.

If I remove "--prefix=python_install" to use instead the default directory, the same strategy works at 1st (even if module is not installed).

Also if I try pip3 install --prefix="/home/user/python_install" pytz and then run the script, it is capable of import the module at first run without issues.