You can specify the install-option CLI argument to set the prefix path of the installation directory while installing a new module. For example, if you want to install your package to /tmp, then run the following command −
pip install --install-option="--prefix=/tmp" package_name