A development version of pipx supports a feature that address this pain point. See pull request #916 [1]
In your script example.py, you would specify your dependencies in a special comment like this:
# Requirements:
# requests
import requests
...
Then you could run the script like this: pipx run file:example.py
This would install the dependencies in a temporary virtual environment, and run the script in that virtual environment.