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

shiny doesn't work along with the latest ipython version #1587

Open
shrektan opened this issue Jul 30, 2024 · 2 comments
Open

shiny doesn't work along with the latest ipython version #1587

shrektan opened this issue Jul 30, 2024 · 2 comments

Comments

@shrektan
Copy link

Package Compatibility Issue: ipython and shiny with Poetry

Summary

When using Poetry to manage a Python project that includes both ipython and shiny, a version conflict occurs due to incompatible dependencies on prompt-toolkit. This issue prevents the installation of both packages in their latest versions.

Error Message

Because no versions of questionary match >2.0.0,<2.0.1 || >2.0.1
 and questionary (2.0.0) depends on prompt_toolkit (>=2.0,<=3.0.36), questionary (>=2.0.0,<2.0.1 || >2.0.1) requires prompt_toolkit (>=2.0,<=3.0.36).
And because questionary (2.0.1) depends on prompt_toolkit (>=2.0,<=3.0.36), questionary (>=2.0.0) requires prompt_toolkit (>=2.0,<=3.0.36).
Because no versions of shiny match >1.0.0,<2.0.0
 and shiny (1.0.0) depends on questionary (>=2.0.0), shiny (>=1.0.0,<2.0.0) requires questionary (>=2.0.0).
Thus, shiny (>=1.0.0,<2.0.0) requires prompt_toolkit (>=2.0,<=3.0.36).
And because ipython (8.26.0) depends on prompt-toolkit (>=3.0.41,<3.1.0)
 and no versions of ipython match >8.26.0,<9.0.0, shiny (>=1.0.0,<2.0.0) is incompatible with ipython (>=8.26.0,<9.0.0).
So, because polarstar depends on both shiny (^1.0.0) and ipython (^8.26.0), version solving failed.

Steps to Reproduce

  1. Create a new directory (e.g., test)
  2. Initialize a new Poetry project:
    poetry init
    
  3. Add ipython to the project:
    poetry add ipython
    
  4. Attempt to add shiny to the project:
    poetry add shiny
    
  5. Observe the error message above

Root Cause

The conflict arises from incompatible version requirements for prompt-toolkit:

  • shiny depends on questionary, which requires prompt-toolkit (>=2.0,<=3.0.36)
  • ipython (version 8.26.0) requires prompt-toolkit (>=3.0.41,<3.1.0)

These requirements cannot be satisfied simultaneously, causing the dependency resolution to fail.

Workaround

Manually specify a lower version of ipython that is compatible with the required version of prompt-toolkit. For example:

poetry add [email protected]

Then add shiny:

poetry add shiny

Proposed Solutions

  1. Update shiny or its dependencies to support newer versions of prompt-toolkit.
  2. Investigate if ipython can be made compatible with a wider range of prompt-toolkit versions.
  3. Consider creating a compatibility layer or shim to allow these packages to coexist.
@gadenbuie
Copy link
Collaborator

gadenbuie commented Jul 30, 2024

Interesting, shiny requires questionary>=2.0.0, but poetry seems to be excluding questionary 2.0.1.

Can you try installing questionary v2.0.1, which requires prompt_toolkit = ">=2.0,<4.0"?

@gadenbuie
Copy link
Collaborator

Oh wait, I was looking at questionary's GitHub repo which has updates but is still at 2.0.1. It looks like questionary plans to push a new release soon that will remove the prompt_toolkit restriction.

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

3 participants