What to use instead of "--use-mirrors" in PIP?

3

When I run the following command I get the following response:

sudo pip install --use-mirrors -r test-infra/requirements.txt

Usage:   
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options] ...
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

no such option: --use-mirrors

Reading on link I discovered that the following commands were removed in version 7.0.0:

  

BACKWARD INCOMPATIBLE Removed the deprecated --mirror , --use-mirrors , and -M options.

What to use instead of --use-mirrors ?

    
asked by anonymous 09.03.2016 / 20:13

2 answers

2

Nothing. Just do not put the option - let pip install -r test-infra/requirements.txt

Today there are no mirrors from the original PyPi Store - I suppose the improvement in scalability of networked systems has eliminated this over the past few years.

You can instead configure PIP to search for packages on other pipy-compatible systems - and many organizations / companies establish their private repositories. But the parameters for this are other, and the purpose is different from what would have been user mirrors in the past.

Now a related aspect, but that's not what you asked: you should not use PIP in conjunction with sudo on any Linux distribution. It turns out that the way that PIP does not run the files it installs and downloads next to the file manager of your Linux (either apt-get in the derivatives of debian, or dnf in fedora and RedHat, or any other): then when you go update Python packages by the Linux manager - and this happens naturally in the maintenance of your system, there will be conflict of these files.

In short - the habit of using sudo pip install ... potentially, emuito probably will ruin your Linux!

The PIP should be used in local Python project environments, created with the virtualenv command - see here: link (but of course, contrary to what they teach on this page, install your virtualenv on Linux with sudo apt-get install python-virtualenv or the equivalent Linux command - not with pip)

    
09.03.2016 / 21:36
0

You can use --index-url or --extra-index-url to manually determine the package mirrors, see the changelog:

  

BACKWARD INCOMPATIBLE pip no longer supports the --use-mirrors, -M,   and --mirrors flags. The mirroring support has been removed. In order   to use the mirror specify it as the primary index with -i or   --index-url, or an additional index with --extra-index-url. (PR # 1098, CVE-2013-5123)

    
09.03.2016 / 21:34