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

Asked

Viewed 156 times

4

When running the following command I get the following answer:

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 in https://pip.pypa.io/en/stable/news/ found that the following commands were removed in version 7.0.0:

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

What to wear instead of --use-mirrors?

2 answers

3


Nothing. Just don’t put the option - leave pip install -r test-infra/requirements.txt

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

It is possible to 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 than what would have been the "user mirrors" in the past.

Now a related aspect, but that’s not what you asked: you shouldn’t use PIP in conjunction with sudo in no Linux distribution. It turns out that the way that PIP does not rgistra the files that it installs and downloads together with your Linux file manager (either apt-get in debian derivavdos, or dnf in Fedora and Redhat, or any other): so when you go to 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 will probably spoil your Linux!

PIP should be used in local Python project environments, created with the virtualenv command - see here in English: http://www.devfuria.com.br/python/virtualenv/ (but of course, contrary to what they teach on this page, install SEU virtualenv on Linux with sudo apt-get install python-virtualenv or the equivalent Linux command - not with Pip)

  • That’s exactly what I thought, I just wasn’t sure, I’m going to run some more tests and over the weekend I might check the answer :) +1

  • After a test, I understood why I was using sudo in the repository that I am trying to work, it is because of a "package" that makes the test in the infrastructure, anyway the doubt was solved, thanks!

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 a mirror specify it as the Primary index with -i or --index-url, or as an Additional index with --extra-index-url. (PR #1098, CVE-2013-5123)

  • Could you provide an example? I’m not sure how to use

Browser other questions tagged

You are not signed in. Login or sign up in order to post.