What to do when pip dependency resolver wants to use conflicting django plotly dash versions of a application?
Asked Answered
V

4

10

So I'm trying to integrate plotly with my django app however I'm having an issue rendering a chart. I was using VSCode which did not pick up the dependency conflict.

However when i started to use Pycharm. It said my Dash was version 1.11 which satisfies the django-plotly-dash but did not satisfy the dash_bootstrap_components which required 2.0.0

I have now installed Dash version 1.10 which conflicts with both apps just to show the error message below:

Relevant error code

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following de
pendency conflicts.
django-plotly-dash 1.6.6 requires dash<1.21.0,>=1.11, but you have dash 1.10.0 which is incompatible.
dash-bootstrap-components 1.0.3 requires dash>=2.0.0, but you have dash 1.10.0 which is incompatible.

Any help is appreciated

Answer

As django-plotly-dash is on the latest version, i've decided to install dash 1.20 and downgrade by dash-bootstrap-components to 0.13.0 (https://github.com/facultyai/dash-bootstrap-components/releases?page=2)

This has worked like a charm.. weirdly - Pycharm has a reference error for the imports but visual studio code does not show any error and my program/script works perfectly. The pycharm import issue may be due to a setting in pycharm? idk

Vorous answered 21/2, 2022 at 11:18 Comment(1)
thanks, i did not know this! edit: i feel weird making my own answer as the solution heheVorous
V
1

As django-plotly-dash is on the latest version, i've decided to install dash 1.20 and downgrade by dash-bootstrap-components to 0.13.0 (https://github.com/facultyai/dash-bootstrap-components/releases?page=2)

This has worked like a charm.. weirdly - Pycharm has a reference error for the imports but visual studio code does not show any error and my program/script works perfectly. The pycharm import issue may be due to a setting in pycharm? idk

Vorous answered 14/6, 2022 at 21:37 Comment(0)
P
5

The simplest way to solve this issue is to install the compatible dash vision that is greater than 1.11 and less than 1.21.0.

Solution:

py -m pip install dash==1.20.0 
Precedency answered 22/4, 2022 at 5:0 Comment(0)
V
3

The accepted solution can certainly help when the solution is possible (when the dependencies overlap).

A best practice, however, is to let pip's resolver do its job. As the error suggests, it can't take into consideration packages "that are [already] installed." To avoid this problem, install all of your packages in one command.

e.g.

Instead of...

pip install packageA
pip install packageB
pip install packageC

do...

pip install packageA packageB packageC

Using the first method, when installing packageC, pip can't reconcile dependencies required by packageA or packageB. Since they are already installed, it would be unacceptable behavior to re-install dependencies and their dependencies.

Doing them all together, gives pip the freedom to install all packages and their transient dependencies in a compatible combination.

That's assuming there is a compatible combination... 🤷.

Viguerie answered 6/2 at 22:49 Comment(0)
V
1

As django-plotly-dash is on the latest version, i've decided to install dash 1.20 and downgrade by dash-bootstrap-components to 0.13.0 (https://github.com/facultyai/dash-bootstrap-components/releases?page=2)

This has worked like a charm.. weirdly - Pycharm has a reference error for the imports but visual studio code does not show any error and my program/script works perfectly. The pycharm import issue may be due to a setting in pycharm? idk

Vorous answered 14/6, 2022 at 21:37 Comment(0)
T
-1

Before you install your extension, just follow the prompts

pip install h5py pip install typing-extensions pip install wheel

and then install your extension

Torino answered 12/9, 2023 at 10:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.