I am forced to download python packages from local mirror PyPi repository. I do this by using the -i
and --trusted-host
options. Whole installation command looks like this:
pip install -i https://sampleurl.com/pypi-remote/simple --trusted-host sample.host.com package_name
Having to type in that options each time is kinda annoying though (in reality those are long URL's). I've tried to create get_package.bat
file (I'm working on Windows 10) with following content:
pip install -i https://sampleurl.com/pypi-remote/simple --trusted-host sample.host.com "%1"
It works perfectly fine, although when I wanted to execute pip search command, it turned out to be useless since it has hard-coded install
command and there is no way to use it with search
.
Is there any way in which I can setup pip to download from mirror repository by default, so that I can execute pip install package_name
or pip search package_name
without any additional options?
Eventually I could try making .bat
file that would take 2 parameters like this:
pip %1 -i https://sampleurl.com/pypi-remote/simple --trusted-host sample.host.com "%2"
But I wonder if there's more "elegant" way to do this.