If I try to install importlib in Python 2.7, I get the following:
Downloading/unpacking importlib (from -r dev-requires.txt (line 8))
Downloading importlib-1.0.2.tar.bz2
Running setup.py egg_info for package importlib
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/jason/src/apture/build/importlib/setup.py", line 6,
in <module>
raise Exception("importlib is included in Python 2.7 and newer
for 2.x")
Exception: importlib is included in Python 2.7 and newer for 2.x
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/jason/src/apture/build/importlib/setup.py", line 6, in
<module>
raise Exception("importlib is included in Python 2.7 and newer for
2.x")
Exception: importlib is included in Python 2.7 and newer for 2.x
This makes it kind of a pain to keep a requirements file that works
with both python 2.6 and 2.7. Has anyone found a way around this? I
suppose the ideal solution would be to have a way to not install
certain dependencies for certain python versions, but that may be
overkill for just this one library.
On Wed, May 4, 2011 at 1:18 PM, Jason Baker <amnorv...@gmail.com> wrote: > If I try to install importlib in Python 2.7, I get the following:
> Downloading/unpacking importlib (from -r dev-requires.txt (line 8)) > Downloading importlib-1.0.2.tar.bz2 > Running setup.py egg_info for package importlib > Traceback (most recent call last): > File "<string>", line 14, in <module> > File "/home/jason/src/apture/build/importlib/setup.py", line 6, > in <module> > raise Exception("importlib is included in Python 2.7 and newer > for 2.x") > Exception: importlib is included in Python 2.7 and newer for 2.x > Complete output from command python setup.py egg_info: > Traceback (most recent call last):
> File "<string>", line 14, in <module>
> File "/home/jason/src/apture/build/importlib/setup.py", line 6, in > <module>
> raise Exception("importlib is included in Python 2.7 and newer for > 2.x")
> Exception: importlib is included in Python 2.7 and newer for 2.x
> This makes it kind of a pain to keep a requirements file that works > with both python 2.6 and 2.7. Has anyone found a way around this? I > suppose the ideal solution would be to have a way to not install > certain dependencies for certain python versions, but that may be > overkill for just this one library.
> -- > You received this message because you are subscribed to the Google Groups > "virtualenv" group. > To post to this group, send email to python-virtualenv@googlegroups.com. > To unsubscribe from this group, send email to > python-virtualenv+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/python-virtualenv?hl=en.
> If I try to install importlib in Python 2.7, I get the following:
> Downloading/unpacking importlib (from -r dev-requires.txt (line 8)) > Downloading importlib-1.0.2.tar.bz2 > Running setup.py egg_info for package importlib > Traceback (most recent call last): > File "<string>", line 14, in <module> > File "/home/jason/src/apture/build/importlib/setup.py", line 6, > in <module> > raise Exception("importlib is included in Python 2.7 and newer > for 2.x") > Exception: importlib is included in Python 2.7 and newer for 2.x > Complete output from command python setup.py egg_info: > Traceback (most recent call last):
> File "<string>", line 14, in <module>
> File "/home/jason/src/apture/build/importlib/setup.py", line 6, in > <module>
> raise Exception("importlib is included in Python 2.7 and newer for > 2.x")
> Exception: importlib is included in Python 2.7 and newer for 2.x
> This makes it kind of a pain to keep a requirements file that works > with both python 2.6 and 2.7. Has anyone found a way around this? I > suppose the ideal solution would be to have a way to not install > certain dependencies for certain python versions, but that may be > overkill for just this one library.
Yeah, I'm not really sure how to solve this in a requirements file - I don't think we want to start complexifying the format with things like conditionals.
A request was filed recently for an option for pip to not bomb out entirely if a single package fails, but continue with the rest and report which one(s) failed. I'm not sure how such an option would interact with dependencies, but it occurs to me that option might help in this situation, too.
Otherwise, about all I can recommend is a python26-requirements.txt file that looks like this:
> On 05/04/2011 01:18 PM, Jason Baker wrote: >> If I try to install importlib in Python 2.7, I get the following:
>> Downloading/unpacking importlib (from -r dev-requires.txt (line 8)) >> Downloading importlib-1.0.2.tar.bz2 >> Running setup.py egg_info for package importlib >> Traceback (most recent call last): >> File "<string>", line 14, in <module> >> File "/home/jason/src/apture/build/importlib/setup.py", line 6, >> in <module> >> raise Exception("importlib is included in Python 2.7 and newer >> for 2.x") >> Exception: importlib is included in Python 2.7 and newer for 2.x >> Complete output from command python setup.py egg_info: >> Traceback (most recent call last):
>> File "<string>", line 14, in <module>
>> File "/home/jason/src/apture/build/importlib/setup.py", line 6, in >> <module>
>> raise Exception("importlib is included in Python 2.7 and newer for >> 2.x")
>> Exception: importlib is included in Python 2.7 and newer for 2.x
>> This makes it kind of a pain to keep a requirements file that works >> with both python 2.6 and 2.7. Has anyone found a way around this? I >> suppose the ideal solution would be to have a way to not install >> certain dependencies for certain python versions, but that may be >> overkill for just this one library.
> Yeah, I'm not really sure how to solve this in a requirements file - I > don't think we want to start complexifying the format with things like > conditionals.
I'm curious if we could support a limited set similiar to
I guess there is also a question of where is the authority for modules that have been imported into stdlib where backports exist. We could specifically 'know' that if you are > python2.7 importlib is satisfied as an internal dependency. It'd be like listing urllib2 or some such in the requirements - which interestingly does:
pip install urllib2 Downloading/unpacking urllib2 Real name of requirement urllib2 is urllib3 Could not find any downloads that satisfy the requirement urllib2 No distributions at all found for urllib2 Storing complete log in /Users/pnasrat/.pip/pip.log
Currently we assume all requirements are external, so don't handle this well.
> A request was filed recently for an option for pip to not bomb out > entirely if a single package fails, but continue with the rest and > report which one(s) failed. I'm not sure how such an option would > interact with dependencies, but it occurs to me that option might help > in this situation, too.
I've taken a look at that bug whilst triaging, and I think we probably need to break down the use cases for that a bit more. I can see the case for where you type
pip install foo bar baz
Where there is no relationship between them and say you mistyped one should the whole thing succeed or fail. I guess it comes down to do we want pip install to be transactional or operate on partial sets. As you said dependencies make that more complex, and it doesn't help that we don't have a complete set of metadata to figure out the dependency graph at the start of the operation IIRC