Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why is pip so SLOW to download? (how to troubleshoot?)

Tags:

I can wget e.g. python coverage and pip install the package locally quickly and without any problem, but pip install coverage takes forever. Using pip 1.3.1 in a virtual env on Ubuntu 12.04. Any idea what could be the hold-up?

like image 983
Tony Schmidt Avatar asked Mar 26 '13 03:03

Tony Schmidt


People also ask

How do I make pip install faster?

Going (very slightly) faster by disabling the version check You can disable this check like so: pip --disable-pip-version-check install ... This saves me about 0.2-0.3s, not a very significant improvement; the actual improvement probably depends on your network speed and other factors.

How do you fix error you must give at least one requirement to install see pip help install?

You must give at least one requirement to install (see "pip help install") You are using pip version 9.0. 1, however version 9.0. 3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Why cant I do pip install?

One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.


1 Answers

As Donald Stufft answered in pip issue 864, it happens because pip crawls a lot of pages looking for package sdists, and this behavior was inherited from easy_install. Some packages do not work if you remove that feature, and some guys started a new PEP to remove this external links behavior: PEP 438 - Transitioning to release-file hosting on PyPI

Donald said "Until PEP438 is implemented you can also use the restricted API of Crate.io, pip install -i https://restricted.crate.io/ this will only install releases that are directly hosted."

But as Marcus Smith mentioned in the virtualenv mailing list, you can download the package and its dependencies, and them ignore PyPI and use your download directory: http://www.pip-installer.org/en/latest/cookbook.html#fast-local-installs


Example using https://restricted.create.io to avoid the external links behavior:

$ pip install -i https://restricted.crate.io/ coverage 

References:

  • https://github.com/pypa/pip/issues/864
  • http://www.python.org/dev/peps/pep-0438/
  • https://groups.google.com/forum/?fromgroups=#!topic/python-virtualenv/UDWsPHKHvjY
like image 104
Hugo Tavares Avatar answered Oct 21 '22 15:10

Hugo Tavares