Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum34 and other dependencies not installing when targetting 2.7 but using 3.6 #1279

Closed
nesl247 opened this issue Jan 8, 2018 · 7 comments
Closed

Comments

@nesl247
Copy link

nesl247 commented Jan 8, 2018

Describe your environment
  1. macOS 10.13
  2. Python version: 2.7.10 / 3.6.4
  3. Pipenv version: 9.0.1
Expected result

enum34 should be required

Actual result

enum34 is not required

Steps to replicate

I installed pipenv via homebrew, and that uses python 3. When doing so, the Pipfile.lock does not include enum34. However, if I remove pipenv and install it via pip2 install pipenv, then it does. It appears that pipenv is not generating the requirements properly as flake8 requires enum34 conditionally based on the python version.

@techalchemy
Copy link
Member

@nesl247 thanks for the report -- this is an issue with dependency resolution for certain types of setup.py configurations when crossing python versions from the pipenv-installed python version to the virtualenv python version. We are aware of the issue and tracking it over in #857 so I'm going to close this out for now, thanks for reporting!

@drakeguan
Copy link

The same situation here. And I'd like to provide more information to see if that helps.

Describe your environment

macOS 10.12.6
Python version: 2.7.10 / 3.6.4
Pipenv version: 9.0.1

Both Python and Pipenv are installed through brew.

Pipfile:

[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]
jupyter = "*"

[dev-packages]

[requires]
python_version = "2.7"

Expected result

enum34 should be required and installed because of jupyter.

Actual result

enum34 is not installed.

Steps to replicate

pipenv install

Creating a virtualenv for this project…
Using /usr/local/bin/python2.7 to create virtualenv…
⠋Running virtualenv with interpreter /usr/local/bin/python2.7
New python executable in /Users/drakeguan/.local/share/virtualenvs/datateam_workshop_dl-L7ge0fpr/bin/python2.7
Also creating executable in /Users/drakeguan/.local/share/virtualenvs/datateam_workshop_dl-L7ge0fpr/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /Users/drakeguan/.local/share/virtualenvs/datateam_workshop_dl-L7ge0fpr
Installing dependencies from Pipfile.lock (fbd131)…
Ignoring ipython: markers 'python_version >= "3.3"' don't match your environment
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 42/42 — 00:00:09
To activate this project's virtualenv, run the following:
 $ pipenv shell

pipenv graph | less

appnope==0.1.0
jupyter==1.0.0
  - ipykernel [required: Any, installed: 4.8.0]
    - ipython [required: >=4.0.0, installed: ?]
    - jupyter-client [required: Any, installed: 5.2.2]
      - jupyter-core [required: Any, installed: 4.4.0]
        - traitlets [required: Any, installed: 4.3.2]
          - decorator [required: Any, installed: 4.2.1]
          - enum34 [required: Any, installed: ?]
          - ipython-genutils [required: Any, installed: 0.2.0]
          - six [required: Any, installed: 1.11.0]
      - python-dateutil [required: >=2.1, installed: 2.6.1]
        - six [required: >=1.5, installed: 1.11.0]
      - pyzmq [required: >=13, installed: 16.0.4]
      - tornado [required: >=4.1, installed: 4.5.3]
        - backports-abc [required: >=0.4, installed: 0.5]
        - certifi [required: Any, installed: 2018.1.18]
        - singledispatch [required: Any, installed: 3.4.0.3]
          - six [required: Any, installed: 1.11.0]
      - traitlets [required: Any, installed: 4.3.2]
        - decorator [required: Any, installed: 4.2.1]
        - enum34 [required: Any, installed: ?]
        - ipython-genutils [required: Any, installed: 0.2.0]
        - six [required: Any, installed: 1.11.0]
    - tornado [required: >=4.0, installed: 4.5.3]
      - backports-abc [required: >=0.4, installed: 0.5]
      - certifi [required: Any, installed: 2018.1.18]
      - singledispatch [required: Any, installed: 3.4.0.3]
        - six [required: Any, installed: 1.11.0]
    - traitlets [required: >=4.1.0, installed: 4.3.2]
      - decorator [required: Any, installed: 4.2.1]
      - enum34 [required: Any, installed: ?]
      - ipython-genutils [required: Any, installed: 0.2.0]
      - six [required: Any, installed: 1.11.0]

Workaround steps

If I manually install jupyter and other packages through pipenv commandline, it would work. That is, the following way can install dependencies correctly.

pipenv install jupyter

pipenv graph | less

  - ipykernel [required: Any, installed: 4.8.0]
    - ipython [required: >=4.0.0, installed: 5.5.0]
      - appnope [required: Any, installed: 0.1.0]
      - backports.shutil-get-terminal-size [required: Any, installed: 1.0.0]
      - decorator [required: Any, installed: 4.2.1]
      - pathlib2 [required: Any, installed: 2.3.0]
        - scandir [required: Any, installed: 1.6]
        - six [required: Any, installed: 1.11.0]
      - pexpect [required: Any, installed: 4.3.1]
        - ptyprocess [required: >=0.5, installed: 0.5.2]
      - pickleshare [required: Any, installed: 0.7.4]
        - pathlib2 [required: Any, installed: 2.3.0]
          - scandir [required: Any, installed: 1.6]
          - six [required: Any, installed: 1.11.0]
      - prompt-toolkit [required: <2.0.0,>=1.0.4, installed: 1.0.15]
        - six [required: >=1.9.0, installed: 1.11.0]
        - wcwidth [required: Any, installed: 0.1.7]
      - pygments [required: Any, installed: 2.2.0]
      - setuptools [required: >=18.5, installed: 38.5.0]
      - simplegeneric [required: >0.8, installed: 0.8.1]
      - traitlets [required: >=4.2, installed: 4.3.2]
        - decorator [required: Any, installed: 4.2.1]
        - enum34 [required: Any, installed: 1.1.6]
        - ipython-genutils [required: Any, installed: 0.2.0]
        - six [required: Any, installed: 1.11.0]```

@uranusjr
Copy link
Member

uranusjr commented Feb 6, 2018

This looks like another instance of #1229. Traitlets uses the old extra_requires syntax to specify conditional dependencies, which is not picked up correctly by Pipenv. The best solution would be to submit a pull request to Traitlets to amend this.

@drakeguan
Copy link

drakeguan commented Feb 10, 2018

@uranusjr Thanks for sharing this. I noticed there are lots of python packages utilizing extras_require for platform specific dependencies instead of the suggested way in setuptools. It might be time-consuming to make all (or just popular) python packages to update that ;)

@techalchemy
Copy link
Member

I may have a rework of a prior fix for this but it is a complicated problem so I make no promises

@neetjn
Copy link

neetjn commented Feb 25, 2018

Was there an update on this? This issue is blocking use with Python 2.7.

@apiraino
Copy link

apiraino commented Mar 1, 2018

@uranusjr thanks for pointing me to the right direction. I'm experiencing the same problem with the jsonschema package setup.py .

I'm in a python3 virtualenv and an additional python2.7 package is downloaded by mistake: that causes a crash and the whole package installation process to abort (I can provide a clean test case for the bug, if interested).

I'll submit a quick patch to the maintainers of jsonschema since this bug in pipenv is blocking me from migrating from pip.

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

No branches or pull requests

6 participants