Search code examples
pythonpython-2.7pippygametmx

Installing old versions of dependencies within a python virtualenv and receiving ERROR: No matching distribution found for tiledtmxloader==3.1.0


I'm trying to run an old github project. It runs on python2.7, so I created a virtualenv for it, which uses pip==20.3.4 and am trying to install everything and run it within source ./venv/bin/activate

The dependencies in it are listed as

      install_requires = ['Django == 1.5.1',
                          'pyglet >= 1.1.4',
                          'tiledtmxloader >= 3.0.3',
                          'pygame>=1.9.1',
                         ],

but since the newest versions of these packages don't won't with python2.7 or the project the way that it is, I changed these dependencies to == instead of >=

      'Django == 1.5.1',
      'pyglet == 1.1.4',
      'tiledtmxloader == 3.0.3',
      'pygame==1.9.1',

I was able to install the older version of pyglet but for the other packages, I received errors like

ERROR: Could not find a version that satisfies the requirement tiledtmxloader==3.1.0 (from versions: 3.1.0.131)
ERROR: No matching distribution found for tiledtmxloader==3.1.0

RROR: Could not find a version that satisfies the requirement pygame==1.9.1 (from versions: 1.9.2b5, 1.9.2b6, 1.9.2rc1, 1.9.2, 1.9.3, 1.9.4.dev0, 1.9.4rc1, 1.9.4, 1.9.5.dev0, 1.9.5rc1, 1.9.5rc2, 1.9.5, 1.9.6rc1, 1.9.6rc2, 1.9.6, 2.0.0.dev1, 2.0.0.dev2, 2.0.0.dev3, 2.0.0.dev4, 2.0.0.dev6, 2.0.0.dev8, 2.0.0.dev10, 2.0.0.dev12, 2.0.0.dev14, 2.0.0.dev16, 2.0.0.dev18, 2.0.0.dev20, 2.0.0.dev22, 2.0.0.dev24, 2.0.0, 2.0.1.dev1, 2.0.1)
ERROR: No matching distribution found for pygame==1.9.1

Are the older versions of these packages available for download? All I want to do is execute the program, so it makes way more sense to just download the older packages and run the program as is, than to try to convert it to python3. I don't even know if I'll like the program after I update it.


I would like to know how to download these packages, so that I can run the project as is, without having to do any edits


Solution

  • By default pip downloads packages from Python Pakckage Index so when you run pip install tiledtmxloader it goes to https://pypi.org/project/tiledtmxloader/#history (well, actually it goes to Simple API) looking for a version that corresponds to your platform (processor architecture, 32- vs 64-bitness, Python version). Currently tiledtmxloader provides exactly one version 3.1.0.131 that only works with Python 3 so it's certainly not what you want.

    There are Homepage and Download links at PyPI that lead to Google Code Archive. At the download page there are a few old version. I tried the latest, 3.1.0.115, it works with Python 2.7. So try this:

    pip install https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pytmxloader/tiledtmxloader-3.1.0.115.zip
    

    Change setup.py:

      install_requires = ['Django == 1.5.1',
                          'pyglet >= 1.1.4',
                          'tiledtmxloader @ https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pytmxloader/tiledtmxloader-3.1.0.115.zip',
                          'pygame>=1.9.1',
                         ],
    

    This is direct reference, see https://pip.pypa.io/en/stable/cli/pip_install/#requirement-specifiers and https://www.python.org/dev/peps/pep-0440/#direct-references