To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. Defaulting to user installation because normal site-packages is not writeable code example
Example: WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
python -m pip install --upgrade --force-reinstall pip