0

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 :(.

grigoryvp
  • 40,413
  • 64
  • 174
  • 277
  • As a side note: On a clean OS X 10.8 machine, if you start with the stock Python 2.7.2, `sudo easy_install pip`, then `sudo pip install mercurial` or `pip install --download=. mercurial`, it succeeds. Do you have a second Python 2.7 installation that's conflicting with Apple's? – abarnert May 30 '13 at 20:42
  • I just clean installed OSX 10.8.3 onto one of my macs. Issuing `sudo easy_install pip` followed by `pip install --download=. mercurial` ends with mentioned error. But file is actually downloaded! It's not downloaded on Debian 7 / Ubuntu (only error, no file). And downloaded (with error) on Windows 8 with ActivePython and OSX with built-in python. – grigoryvp May 31 '13 at 13:20

1 Answers1

1

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…)

abarnert
  • 354,177
  • 51
  • 601
  • 671
  • Unfortunately, i don't anything in my target directory regardless if i specify it with ',' or as full path. What may be wrong? – grigoryvp May 30 '13 at 20:46
  • @EyeofHell: What version of `pip` do you have? – abarnert May 30 '13 at 21:08
  • @EyeofHell: Hold on a second… you're right, it looks like even the latest `pip` with Python 2.7.2 only copies the tarball into the target directory if `egg_info` succeeds. But the same `pip` with Python 3.3.0 copies it anyway. That seems wrong; you might want to do some more tests to verify this and file a bug. Meanwhile, let me edit the answer. – abarnert May 30 '13 at 21:10
  • @EyeofHell: As a workaround, you can always pass `--download-cache=.` as well. You should see something like `Storing download in cache at ./http%3A%2F%2Fmercurial.selenic.com%2Frelease%2Fmercurial-2.6.1.tar.gz` in the output, and even if you don't, it should be easy to find the file. – abarnert May 30 '13 at 21:15
  • '--download-cache' works only if it works with '--download' (Windows 8, OSX 10.8.3). On Debian and Ubuntu i got only error and no file is downloaded either with '--download' or with '--download-cache'. – grigoryvp May 31 '13 at 13:23
  • @EyeofHell: If you already have the file downloaded to either the specified download cache location _or_ the default one, it won't download anything at all, because it already has it. So, are you sure it's actually doing the download step? – abarnert Jun 01 '13 at 17:43
  • nope, download step is skipped if file was already downloaded. But file is `not` placed in specified folder for both `--download` and `--download-cache`. You can check by yourself by downloading ubuntu or debian for free and running them into freeware virtual machine like `virtualbox`. – grigoryvp Jun 02 '13 at 08:30