Python 2.6 #4

Closed
beloglazov opened this Issue Sep 27, 2012 · 5 comments

Comments

Projects
None yet
2 participants

Hi Tim,

I want to test my project on a server running CentOS 6.3, which only has Python 2.6.6 in the repos. All the libraries that I'm using work fine on 2.6, however, mocktest requires Python 2.7.3. When I try to install mocktest using pip, it tries to install Python 2.7.3, which fails with the following error:

$ sudo pip-python install --upgrade mocktest

Downloading/unpacking mocktest
  Downloading mocktest-0.6.3.tgz (49Kb): 49Kb downloaded
  Running setup.py egg_info for package mocktest
Downloading/unpacking distribute (from mocktest)
  Downloading distribute-0.6.28.tar.gz (627Kb): 627Kb downloaded
  Running setup.py egg_info for package distribute
Downloading/unpacking python<3 (from mocktest)
  Downloading Python-2.7.3.tar.bz2 (11.8Mb): 11.8Mb downloaded
  Running setup.py egg_info for package python
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "/build/python/setup.py", line 9, in <module>
        import sysconfig
    ImportError: No module named sysconfig
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

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

  File "/build/python/setup.py", line 9, in <module>

    import sysconfig

ImportError: No module named sysconfig

Is there a hard requirement for Python 2.7, or can mocktest run on 2.6 as well?

Thanks,
Anton

I just noticed that you are from Melbourne. Nice to know, I'm also in Melbourne :)

Owner

timbertson commented Sep 27, 2012

Cool, nice to see another Melbournite :)

To be honest, I'm not sure why pip would be getting python 2.7 - the only requirement specified is "python<3". I didn't even know pip fetched different python versions, I guess it's getting the latest it knows that satisfies <3. So if there's some way to tell it not to do that, that ought to work fine - I believe it works fine on py2.6 (although I haven't tested it recently, my system only has 2.7 and 3.2).

I tend to use 0install wherever possible, so I'm not well versed in pip. But maybe you can remove the "python" entry from the install_requires field of setup.py and it'll stop trying to download python?

I've just realised why pip tried installing python 2.7, that's because I specified the --upgrade option :) Without this option, mocktest installs and works fine.

Anyways, there is still a package configuration problem since the other packages that I installed with that option didn't try to upgrade python. And it also means that mocktest can't be upgraded via pip. I think you are right about the install_requires=['setuptools', 'python<3'] field. For example, pyqcy doesn't have this (https://github.com/Xion/pyqcy/blob/master/setup.py), and its upgrades go just fine. So, I'm not sure, but maybe it's worth removing 'python<3' from install_requires.

Thanks for the help! Your library is awesome :)

@timbertson timbertson added a commit that referenced this issue Sep 28, 2012

@timbertson timbertson remove python dependency from setup.py because pip does silly things.…
… Fixes (in some sense of the word) issue #4
270367f
Owner

timbertson commented Sep 28, 2012

Pip's behaviour here doesn't seem useful, so I've removed it. I don't know how to specify that mocktest doesn't work on python3 via setup.py, but that's probably not a big deal.

timbertson closed this Sep 28, 2012

Thanks Tim!

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