Skip to content

Conversation

@jankeromnes
Copy link
Member

This is terrible. Please suggest a better solution if you know one.

@jankeromnes
Copy link
Member Author

By the way this is to fix Kresus builds, but the regression affects any other image that uses pip install while expecting Python 2.7.

@jankeromnes
Copy link
Member Author

@bnjbvr Please have a look if you can. 😄

@jankeromnes jankeromnes requested a review from bnjbvr October 6, 2017 09:29
@bnjbvr
Copy link

bnjbvr commented Oct 9, 2017

This is quite unfortunate. It would be more verbose, but would make it sense to apply the strategy advised in https://stackoverflow.com/questions/2812520/pip-dealing-with-multiple-python-versions ? i.e. use pip2 or pip3 whenever it's needed in place of pip.

@jankeromnes
Copy link
Member Author

This is quite unfortunate.

I agree. 😕

i.e. use pip2 or pip3 whenever it's needed in place of pip.

This does seem like the ideal solution, however this only works if you control every call-site of pip. That's not the case for Janitor: Even if we could replace all references to pip with pip2 (e.g. in Kresus' install scripts), there will probably be other dependencies or software projects that will still use pip and expect it to be Python 2.7 (e.g. legacy software projects).

I read somewhere online that pip should use the same Python version as python. However, in current Janitor environments it seems that pip uses 3+ while python is 2.7. Thus I would like to fix pip to correctly reference 2.7 (as python does, because that's what legacy software will expect), and count on more modern software to explicitely use pip2 / pip3 and python2 / python3.

@@ -61,6 +61,7 @@ RUN __LLVM_VERSION__="5.0" \
&& pip install --upgrade pip \
&& pip install --upgrade virtualenv \
&& pip3 install --upgrade pip \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if you do that before pip install --upgrade pip?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I don't think this solves the problem (pip install --upgrade pip says Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages and leaves /usr/local/bin/pip on Python 3.5).

@jankeromnes
Copy link
Member Author

@bnjbvr @Martiusweb Thanks a lot for your input! However, it seems that we couldn't find cleaner solutions than the one I'm proposing, so I think we'll have to go ahead with the binary-overwrite fix for now. Any objections?

@jankeromnes
Copy link
Member Author

ETIMEDOUT

Let's ship this as is.

@jankeromnes jankeromnes merged commit a876b5f into master Oct 17, 2017
@jankeromnes jankeromnes deleted the pip-2.7 branch October 17, 2017 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants