Pipenv: Installing futures backport on Python 2 breaks pipenv on Python 3

Created on 14 Mar 2018  路  9Comments  路  Source: pypa/pipenv

The problem appears on systems with Python 2 installed as a default (unfortunately, will still be around for at least several years!) and pipenv installed on Python 2 accordingly, when users are trying to create and manage Python 3 virtualenvs.

See details about my specific setup here:

https://github.com/pypa/pipenv/issues/1686#issuecomment-373019016


Expected result

pipenv works.

Actual result

pipenv bails out with an exception:

zaytsev@work:~/src/pipenv$ docker run -it --rm pipenv-bug
port Link
  File "/root/.local/lib/python2.7/site-packages/pipenv/../pipenv/vendor/pip9/index.py", line 31, in <module>
    from pip9.wheel import Wheel, wheel_ext
  File "/root/.local/lib/python2.7/site-packages/pipenv/../pipenv/vendor/pip9/wheel.py", line 6, in <module>
    import compileall
  File "/usr/lib/python3.6/compileall.py", line 20, in <module>
    from concurrent.futures import ProcessPoolExecutor
  File "/root/.local/lib/python2.7/site-packages/pipenv/../pipenv/../concurrent/futures/__init__.py", line 8, in <module>
    from concurrent.futures._base import (FIRST_COMPLETED,
  File "/root/.local/lib/python2.7/site-packages/pipenv/../pipenv/../concurrent/futures/_base.py", line 414
    raise exception_type, self._exception, self._traceback
                        ^
SyntaxError: invalid syntax
Steps to replicate
# Build image
zaytsev@work:~/src/pipenv$ docker build . --tag pipenv-bug

# Reproduce bug
zaytsev@work:~/src/pipenv$ docker run -it --rm pipenv-bug

# Debug live
zaytsev@work:~/src/pipenv$ docker run -it --rm pipenv-bug /bin/sh

Dockerfile:

zaytsev@work:~/src/pipenv$ cat Dockerfile 
FROM python:2.7-alpine3.7

WORKDIR /opt

RUN apk add --no-cache python3 gcc musl-dev libffi-dev openssl-dev

RUN pip install --user pipenv

ENV PATH="/root/.local/bin:${PATH}" SHELL="/bin/sh"

RUN pipenv --python 3.6

# Installing this breaks pipenv!
RUN pip install --user futures

CMD ["pipenv", "update", "--dry-run"]

Duplicates:
  • #1686
  • #1603
  • #1589
  • #1553

Most helpful comment

@kennethreitz I am very disappointed by your reaction. I have really put much time into helping you to isolate, reproduce and debug this issue. I have finally created a working reproducer that you can just run out of the box on any system, so as suggested in the other issue, I've opened a new clean issue with detailed explanations on how to reproduce the isolated problem.

Obviously, this is the first step to fixing the issue. If I didn't want to help you, I would have spared the time I invested so far and went out to get drunk instead of tinkering with Docker...

Whether I will be able to find enough time to submit a pull request, I don't know. I hope so, but I'm unfamiliar with pipenv code. Now, on top of that, your reaction doesn't sound welcoming at all, and frankly speaking, I feel demotivated.

All 9 comments

If you'd like to help, please try to help fix the problem, instead of continuing to tell us about it in new and creative ways.

@kennethreitz I am very disappointed by your reaction. I have really put much time into helping you to isolate, reproduce and debug this issue. I have finally created a working reproducer that you can just run out of the box on any system, so as suggested in the other issue, I've opened a new clean issue with detailed explanations on how to reproduce the isolated problem.

Obviously, this is the first step to fixing the issue. If I didn't want to help you, I would have spared the time I invested so far and went out to get drunk instead of tinkering with Docker...

Whether I will be able to find enough time to submit a pull request, I don't know. I hope so, but I'm unfamiliar with pipenv code. Now, on top of that, your reaction doesn't sound welcoming at all, and frankly speaking, I feel demotivated.

I appreciate you coming up with a reproducible example, but you already reported this in another issue, and it was duly noted. We're not magicians 鈥斅燿emanding that this software work in every possible installation environment imaginable is not reasonable.

This seems like something we'll run into a lot, so if you're going to go through all the effort of making a reproducible example, after already going into much detail about how to replicate the issue before, I'd much rather have you spend that energy on fixing the problem instead of giving us more work to do.

e.g. This is a primarily volunteer project, and we're extremely understaffed.

I assume you have a million things to do but, your posts come off a little brash. Based on @zyv's response I'm not the only passerby to be put off by your answers.

If you know that and don't care, then godspeed and good luck. But if not, please consider that perceived curtness might hurt in converting random strangers into contributors.

try 11.8.3

Awesome, it seems to work for me! Many thanks :)

\o/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ansrivas picture ansrivas  路  3Comments

erinxocon picture erinxocon  路  3Comments

AkiraSama picture AkiraSama  路  3Comments

leileigong picture leileigong  路  3Comments

jeyraof picture jeyraof  路  3Comments