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

pipenv fails to install jupyterlab #2880

Closed
whyboris opened this issue Sep 21, 2018 · 13 comments · Fixed by #2935
Closed

pipenv fails to install jupyterlab #2880

whyboris opened this issue Sep 21, 2018 · 13 comments · Fixed by #2935

Comments

@whyboris
Copy link

whyboris commented Sep 21, 2018

Issue description

I run pipenv install jupyterlab
It correctly installs v0.34.11
Gives this error:

Could not find a version that matches prompt-toolkit<2.0.0,<2.1.0,==1.0.15,>=1.0.15,>=2.0.0

While the tree pipenv graph shows prompt-toolkit only in two lines:

jupyterlab==0.34.11
  - jupyterlab-launcher [required: >=0.13.1,<0.14.0, installed: 0.13.1]
...
    - notebook [required: >=4.2.0, installed: 5.7.0]
...
          - prompt-toolkit [required: >=2.0.0,<2.1.0, installed: 2.0.4]
...
  - notebook [required: >=4.3.1, installed: 5.7.0]
...
        - prompt-toolkit [required: >=2.0.0,<2.1.0, installed: 2.0.4]
...
Expected result

Install without the weird version error

Actual result

see above.

Steps to replicate

create a new directory with python_version = "3.6" and run pipenv install jupyterlab


$ pipenv --support

Pipenv version: '2018.7.1'

Pipenv location: '/usr/local/Cellar/pipenv/2018.7.1/libexec/lib/python3.7/site-packages/pipenv'

Python location: '/usr/local/Cellar/pipenv/2018.7.1/libexec/bin/python3.7'

Other Python installations in PATH:

  • 2.7: /usr/local/bin/python2.7

  • 2.7: /usr/local/bin/python2.7

  • 2.7: /usr/bin/python2.7

  • 3.6: /Users/byakubchik/.local/share/virtualenvs/ml-with-python-and-keras-u1_RmhqT/bin/python3.6m

  • 3.6: /Users/byakubchik/.local/share/virtualenvs/ml-with-python-and-keras-u1_RmhqT/bin/python3.6

  • 3.6: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6

  • 3.6: /usr/local/bin/python3.6

  • 3.7: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m

  • 3.7: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7

  • 3.7: /usr/local/bin/python3.7

  • 3.6.4: /Users/byakubchik/.local/share/virtualenvs/ml-with-python-and-keras-u1_RmhqT/bin/python

  • 2.7.15: /usr/local/bin/python

  • 2.7.10: /usr/bin/python

  • 2.7.15: /usr/local/bin/python2

  • 3.6.4: /Users/byakubchik/.local/share/virtualenvs/ml-with-python-and-keras-u1_RmhqT/bin/python3

  • 3.7.0: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3

  • 3.6.4: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3

  • 3.7.0: /usr/local/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '17.7.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT '
                     '2018; root:xnu-4570.71.2~1/RELEASE_X86_64',
 'python_full_version': '3.7.0',
 'python_version': '3.7',
 'sys_platform': 'darwin'}

System environment variables:

  • PATH
  • TERM_PROGRAM
  • NVM_CD_FLAGS
  • PIP_PYTHON_PATH
  • SHELL
  • TERM
  • TMPDIR
  • Apple_PubSub_Socket_Render
  • TERM_PROGRAM_VERSION
  • ZSH
  • USER
  • NVM_DIR
  • SSH_AUTH_SOCK
  • __CF_USER_TEXT_ENCODING
  • VIRTUAL_ENV
  • PAGER
  • LSCOLORS
  • PIPENV_ACTIVE
  • _
  • PWD
  • LANG
  • XPC_FLAGS
  • PYTHONDONTWRITEBYTECODE
  • XPC_SERVICE_NAME
  • HOME
  • SHLVL
  • LOGNAME
  • LESS
  • LC_CTYPE
  • NVM_BIN
  • DISPLAY
  • COLORTERM

Pipenv–specific environment variables:

  • PIPENV_ACTIVE: 1

Debug–specific environment variables:

  • PATH: /usr/local/Cellar/pipenv/2018.7.1/libexec/tools:/Users/byakubchik/.local/share/virtualenvs/ml-with-python-and-keras-u1_RmhqT/bin:/usr/local/opt/opencv3/bin:/usr/local/Cellar/pipenv/2018.7.1/libexec/tools:/usr/local/opt/opencv3/bin:/Users/byakubchik/.nvm/versions/node/v8.11.2/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/.composer/vendor/bin:/Library/TeX/texbin:/usr/local/go/bin:/opt/X11/bin
  • SHELL: /bin/zsh
  • LANG: en_US.UTF-8
  • PWD: /Users/byakubchik/Desktop/myML/ml-with-python-and-keras
  • VIRTUAL_ENV: /Users/byakubchik/.local/share/virtualenvs/ml-with-python-and-keras-u1_RmhqT

Contents of Pipfile ('/Users/byakubchik/Desktop/myML/ml-with-python-and-keras/Pipfile'):

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

[packages]
jupyterlab = "*"

[dev-packages]
black = "*"
pylint = "*"

[requires]
python_version = "3.6"

[pipenv]
allow_prereleases = true
@whyboris whyboris changed the title pipenv fails to instal jupyterlab pipenv fails to install jupyterlab Sep 21, 2018
@ociule
Copy link

ociule commented Sep 24, 2018

I've also seen this on the latest pipenv master, unfortunately.

I have not undertaken the effort to find a minimal reproducing example so I have several occurences of prompt-toolkit.

λ pipenv graph | grep prompt
      - prompt-toolkit [required: >=1.0.15,<2.0.0, installed: 1.0.15]
    - prompt-toolkit [required: >=1.0.15,<2.0.0, installed: 1.0.15]
          - prompt-toolkit [required: >=1.0.15,<2.0.0, installed: 1.0.15]
      - prompt-toolkit [required: >=1.0.15,<2.0.0, installed: 1.0.15]
    - prompt-toolkit [required: >=1.0.15,<2.0.0, installed: 1.0.15]
  - prompt-toolkit [required: >=1.0.0,<2.0.0, installed: 1.0.15]
      - prompt-toolkit [required: >=1.0.15,<2.0.0, installed: 1.0.15]

This is after doing pip install --dev --skip-lock

@whyboris you can use pip install --skip-lock as a temporary solution.

@echo66
Copy link

echo66 commented Sep 27, 2018

I'm also experiencing the same issue. Skipping lock is a "solution" but not a good one if you want to be serious on how you manage your environment.

@Fongshway
Copy link

Same issue as well. Is it possible the issue is related to the recent release of ipython v7.0.0, which bumps the requirement to prompt_toolkit>=2.0.0,<2.1.0 from prompt_toolkit>=1.0.15,<2.0.0 in ipython v6.5.0? Unfortunately, I still wasn't able to resolve this by adding ipython = "==6.5.0" in my Pipfile.

@odoublewen
Copy link

Same issue for me. I guess it's impossible to be both <2.0.0 and >=2.0.0 at the same time, eh?

@kmsquire
Copy link

To clarify @odoublewen's comment, somewhere in the Jupyter ecosystem, there are conflicting requirements, where some packages require prompt_toolkit>=2.0.0 and some require prompt_toolkit<2.0.0.

The confusing thing for me is that pip install jupyter (or jupyterlab) works fine within pipenv's virtual environment.

Another, possibly cleaner workaround, is to remove jupyter / jupyterlab from your Pipfile and install manually with

pipenv shell
pip install jupyter # or jupyterlab

I have jupyter as dev dependency, so it's less important to me that pipenv manage it than most of my other packages. But I would love to see a solution to this.

@wpsamurai
Copy link

Same issue as well.

As a workaround you can install ipython==6.5.0 first and after that jupyter:

pipenv install ipython==6.5.0
pipenv install jupyter

@khpeek
Copy link

khpeek commented Sep 29, 2018

Incidentally, I get the same error trying to run pipenv install --dev ipdb. I worked around it by running pipenv install ipython==6.5.0 first as described above by wpsamurai.

@codingleo
Copy link

Installing ipython==6.5.0 first didn't work for me.
But by using --skip-lock worked fine.

I'm using python 3.7.0 and pip 18.0

@joewandy
Copy link

joewandy commented Oct 2, 2018

I can't even install jupyter now without having to use --skip-lock

Pipfile:

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

[packages]
numpy = "*"
pandas = "*"
scipy = "*"
ipython = "*"
matplotlib = "*"
jupyter = "*"

[dev-packages]

[requires]
python_version = "2.7"

$ pipenv install produces:

Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
Could not find a version that matches prompt-toolkit<2.0.0,<2.1.0,==1.0.15,>=1.0.0,>=1.0.4,>=2.0.0
Tried: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 0.9, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.25, 0.26, 0.28, 0.30, 0.31, 0.32, 0.32, 0.32, 0.33, 0.33, 0.33, 0.34, 0.34, 0.34, 0.35, 0.35, 0.35, 0.36, 0.36, 0.36, 0.37, 0.37, 0.37, 0.38, 0.38, 0.38, 0.39, 0.39, 0.39, 0.40, 0.40, 0.40, 0.41, 0.41, 0.41, 0.42, 0.42, 0.42, 0.43, 0.43, 0.43, 0.44, 0.44, 0.44, 0.45, 0.45, 0.45, 0.46, 0.46, 0.46, 0.47, 0.47, 0.47, 0.48, 0.48, 0.48, 0.49, 0.49, 0.49, 0.50, 0.50, 0.50, 0.51, 0.51, 0.51, 0.52, 0.52, 0.52, 0.53, 0.53, 0.53, 0.54, 0.54, 0.54, 0.55, 0.55, 0.55, 0.56, 0.56, 0.56, 0.57, 0.57, 0.57, 0.58, 0.58, 0.58, 0.59, 0.59, 0.59, 0.60, 0.60, 0.60, 1.0.0, 1.0.0, 1.0.0, 1.0.1, 1.0.1, 1.0.1, 1.0.2, 1.0.2, 1.0.2, 1.0.3, 1.0.3, 1.0.3, 1.0.4, 1.0.4, 1.0.4, 1.0.5, 1.0.5, 1.0.5, 1.0.6, 1.0.6, 1.0.6, 1.0.7, 1.0.7, 1.0.7, 1.0.8, 1.0.8, 1.0.8, 1.0.9, 1.0.9, 1.0.9, 1.0.10, 1.0.10, 1.0.10, 1.0.13, 1.0.13, 1.0.13, 1.0.14, 1.0.14, 1.0.14, 1.0.15, 1.0.15, 1.0.15, 2.0.1, 2.0.1, 2.0.1, 2.0.2, 2.0.2, 2.0.2, 2.0.3, 2.0.3, 2.0.3, 2.0.4, 2.0.4, 2.0.4, 2.0.5, 2.0.5, 2.0.5
There are incompatible versions in the resolved dependencies.

@mdgoldberg
Copy link

mdgoldberg commented Oct 2, 2018

EDIT: this uses pipenv 2018.7.1

This issue seems to be related to #875, which does not seem to be completely solved (cc @vphilippon @nateprewitt @techalchemy ). I have a Pipfile with only jupyter with no constraint:

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

[packages]
jupyter = "*"

[dev-packages]

[requires]
python_version = "3.6"

When I run pipenv lock --verbose, I see that the best candidate for jupyter is 1.0.0, which only requires ipython>=5.0.0 and prompt-toolkit<2.0.0,>=1.0.0.

Then in round 2, it finds the best candidate for ipython to be 7.0.1 (the most recent version), which requires prompt-toolkit<2.1.0,>=2.0.0. At the end of round 2, there are the following lines:
adding ['ipython', '==7.0.1,>=4.0.0,>=5.0.0', '[]']
adding ['prompt-toolkit', '<2.0.0,<2.1.0,==1.0.15,>=1.0.0,>=2.0.0', '[]']

So it seems to be pinning the candidates and adding them as constraints, even though ipython==7.0.1 is not actually necessary for my Pipfile. Indeed, round 3 begins with the following current constraints:
ipython==7.0.1,>=4.0.0,>=5.0.0
prompt-toolkit<2.0.0,<2.1.0,==1.0.15,>=1.0.0,>=2.0.0 (1.0.15 was the best candidate found in round 2, and was subsequently pinned and added as a constraint).

So it really seems like #875 is not fixed, unless I am missing something. Is there a reason pipenv's dependency resolution shouldn't find that, say, ipython==5.8.0 would satisfy the jupyter constraint of >=5.0.0 as well as the prompt-toolkit requirement of <2.0.0,>=1.0.0 (ipython 5.8.0 requires >=1.0.4,<2.0.0).

@dragvs
Copy link

dragvs commented Oct 3, 2018

My configuration works just fine as a temporary workaround mentioned earlier by @wpsamurai. There is no need to use --skip-lock with it. In case of a problem you can further try pipenv lock --verbose and introduce results to the discussion.

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

[packages]
ipython = "<7.0.0"
jupyter = "*"

[dev-packages]

[requires]
python_version = "3.6"

Btw:

dragvs:~$ pipenv --version
pipenv, version 2018.7.1

@somonso
Copy link

somonso commented Oct 3, 2018

I suppose that the version of Python may cause the problem.
In a directory, I invoked the following commands, which worked fine.

$ pyenv local 3.6.6
$ pipenv install jupyterlab

However, in another directory, I invoked the following commands, which resulted in the prompt_toolkit problem.

$ pyenv local 3.7.0
$ pipenv install jupyterlab

@icp1994
Copy link

icp1994 commented Oct 4, 2018

In a new clean venv pipenv install jupyterlab didn't produce any issue. In another messy venv I got rid of the issue with pipenv lock --clear

techalchemy added a commit that referenced this issue Oct 7, 2018
- Fixes #2499
- Fixes #2529
- Fixes #2589
- Fixes #2666
- Fixes #2767
- Fixes #2785
- Fixes #2795
- Fixes #2801
- Fixes #2802
- Fixes #2824
- Fixes #2862
- Fixes #2867
- Fixes #2879
- Fixes #2880
- Fixes #2894
- Fixes #2902
- Fixes #2924

Signed-off-by: Dan Ryan <[email protected]>
techalchemy added a commit that referenced this issue Oct 7, 2018
- Fixes #2499
- Fixes #2529
- Fixes #2589
- Fixes #2666
- Fixes #2767
- Fixes #2785
- Fixes #2795
- Fixes #2801
- Fixes #2802
- Fixes #2824
- Fixes #2862
- Fixes #2867
- Fixes #2879
- Fixes #2880
- Fixes #2894
- Fixes #2902
- Fixes #2924

Signed-off-by: Dan Ryan <[email protected]>
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 a pull request may close this issue.