I have pip installed on Windows (bundled with ActivePython), Debian 7 (installed via sudo apt-get install python-pip) and OSX 10.8 (installed via easy_install pip).

I want to download mercurial package without installing it (just a .tar.gaz archive) so i issued following documented command:

pip install --download=. mercurial

On Windows it works, but no file appears in current directory. On Debian and OSX it fails like this:

Downloading/unpacking mercurial
  Running setup.py egg_info for package mercurial
  ...
  lots of text, complains about no headers to compile

What i'm doing wrong? I was sure that pip is not supposed to actually run something with --download command, but it seems that on both Debian and OSX it is trying to install package after downloading :(.

有帮助吗?

解决方案

It doesn't actually build and install the package, but it does do the egg_info step, if that's available for your package on your platform. You can see this from your output (or from ~/.pip/pip.log):

Running setup.py egg_info for package mercurial

Command python setup.py egg_info failed with error code 1 in /var/folders/fl/kgrflrj92pv1yjr_918x0t800000gq/T/pip-build/mercurial

Whether that step succeeds or fails, you still end up with nothing installed to site-packages. However, you may not end up with the tarball in your target directory unless it succeeds. (From a very quick test, it looks like 1.2.1 and 1.4dev1 under Python 2.7.2 both fail to copy the tarball to the target if it fails, while 1.4dev1 under 3.3.0 copies it ether way… But that may be misleading; it's possible that the difference has to do with whether the tarball is already in the download-cache or something…)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top