pip wrongly selects pygame-1.9.1release-py2.6-macosx10.5.zip when installing pygame on Linux #57

Closed
vbabiy opened this Issue Mar 15, 2011 · 9 comments

Comments

Projects
None yet
4 participants
Contributor

vbabiy commented Mar 15, 2011

Hi!

The most annoying part about it is that there is no way to force it to install a specific file that I know is the correct one.

Traceback:

zyv@mypride:~/Desktop$ pip install pygame
Downloading/unpacking pygame
  Downloading pygame-1.9.1release-py2.6-macosx10.5.zip (10.8Mb): 10.8Mb downloaded
  Running setup.py egg_info for package pygame
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
    IOError: [Errno 2] No such file or directory: '/home/zyv/Desktop/build/pygame/setup.py'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

IOError: [Errno 2] No such file or directory: '/home/zyv/Desktop/build/pygame/setup.py'

----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/zyv/.pip/pip.log

Contributor

vbabiy commented Mar 15, 2011

Well, while a valid bug, there is a workaround you can do:

pip install http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz

(or whatever file you know is the correct one).


Original Comment By: Jannis Leidel
Contributor

illume commented Sep 6, 2011

Hi,

We are tracking this issue on the pygame issue tracker here:
https://bitbucket.org/pygame/pygame/issue/59/pygame-has-no-pypi-page-and-cant-be

Any ideas on why this is happening?

Contributor

ogirardot commented Dec 9, 2011

The problem comes from those files on your download page (http://www.pygame.org/download.shtml) :

pygame-1.9.1release-py2.6-macosx10.5.zip 10.3MB
pygame-1.9.1release-py2.5-macosx10.5.zip 10.3MB
pygame-1.9.1release-py2.4-macosx10.5.zip 10.3MB
and 
pygame-1.9.2pre-py2.6-macosx10.6.mpkg.zip
pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip

basically the PackageFinder of pip is crawling your page for links and *.tar, *.zip etc... files representing python packages, and two key facts happen :

  • those files are zip files, not any other plateform dependent files like "mpkg" or "dmg";
  • and they are named just like python packages.

So the package finder treat them as releases, and parse their versions. So on any machine you'll end up with the following "sorted" list :

 Using version 1.9.2pre-py2.7-macosx10.7.mpkg 
 (newest of versions: 1.9.2pre-py2.7-macosx10.7.mpkg, 1.9.2pre-py2.6-macosx10.6.mpkg, 
      1.9.1release-py2.6-macosx10.5, 1.9.1release-py2.5-macosx10.5, 
      1.9.1release-py2.4-macosx10.5, 1.9.1release, 1.9.1release, 
      1.9.0release, 1.8.1release, 1.8.0release, 1.8.0-deps-src, 1.7.1release, 1.6.2,...)

So the possible fix is simple, simply make available for download the dmg/mpkg files or rename them so that they don't appear like Python packages anymore.

Regards,

Olivier.

Contributor

carljm commented Dec 12, 2011

Not sure pip can fix this without backwards-incompatible changes to the finder algorithm. Closing.

@carljm carljm closed this Dec 12, 2011

Contributor

illume commented Dec 14, 2011

@ssaboum thanks.

@carljm I don't think .zip files have a mime type of 'python source package' ;)

We're going to have to change something on the pygame side to get pip working, because of old versions of pip anyway. I think uploading a newer source file should fix it too.

Contributor

illume commented Dec 14, 2011

Note, that the 'macosx10.x' part of the file name should give it away as a py2app generated .zip file.

At one point in time .zip files were deemed better for distribution over .dmg files (I'm not sure this is still the case though).

So the algorithm could be updated to check for the py2app specific file names, where the filename also contains 'macosx%VER%' it is likely to be a mac binary installer.

@carljm carljm reopened this Dec 14, 2011

Contributor

carljm commented Dec 14, 2011

We could add a special case in the finder to discard any files containing "macosx10.", I suppose. Open to pull request.

Contributor

illume commented Dec 14, 2011

Hi,

I can't clone pip at the moment (bad internet connection), and I can't even test it because pip isn't working for me.

In pip/index.py around line 289...

            if ext not in ('.tar.gz', '.tar.bz2', '.tar', '.tgz', '.zip'):
                if link not in self.logged_links:
                    logger.debug('Skipping link %s; unknown archive format: %s' % (link, ext))
                    self.logged_links.add(link)
                return []
            if "macosx10" in link.path and ext in ('.zip'):
                if link not in self.logged_links:
                    logger.debug('Skipping link %s; because it is a macosx10 .zip filename which is probably a binary' % (link))
                    self.logged_links.add(link)
                return []

illume added a commit to illume/pip that referenced this issue Dec 15, 2011

For issue #57 pip wrongly selects a macosx binary .zip file
Instead of a source file it downloads a binary macosx .zip file
which contains a binary installer.
Contributor

carljm commented Dec 16, 2011

Fixed in c8d11de - thanks for the patch!

@carljm carljm closed this Dec 16, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment