Make Matplotlib and Plotly optional #1010
Replies: 9 comments 3 replies
-
You can do that with the |
Beta Was this translation helpful? Give feedback.
-
I meant as Python installation dependencies. These packages don't seem to be central to NiceGui's functionality. |
Beta Was this translation helpful? Give feedback.
-
Ah so your major concern is package installation size? |
Beta Was this translation helpful? Give feedback.
-
Right. I could do something hacky and create dummy |
Beta Was this translation helpful? Give feedback.
-
I would second this - they are great for those that use them, but they are pretty heavy dependencies when none of my applications are likely to use either of them. |
Beta Was this translation helpful? Give feedback.
-
@falkoschindler Will that improve with 1.3 where we load dependencies only when really needed by a ui.element? |
Beta Was this translation helpful? Give feedback.
-
I've just created pull request #1143 which makes these large packages optional. |
Beta Was this translation helpful? Give feedback.
-
Firstly, this change is great - just tried it with 1.3.2 and it saved 38+ MB off my packaged app. Awesome!! 👍 👍 Thanks @rodja and @falkoschindler and thanks @firai for starting the discussion!! With that said... probably my ignorance, but by making these "optional", how would a user know that they need to install these additional dependencies manually? I didn't notice anything in the documentation. I started from scratch in my virtualenv with 1.3.2 and when I ran my app with native mode turned on I got a cryptic error |
Beta Was this translation helpful? Give feedback.
-
Thanks @rodja and @falkoschindler! I'll close the discussion as the request has been fulfilled. Issues regarding import errors, fine-tuning of import logic or documentation can be dealt with by filing specific issues. |
Beta Was this translation helpful? Give feedback.
-
I would like to request making Matplotlib and Plotly optional. If I'm using Plotly, I want to avoid dragging along Matplotlib and all of its dependencies, and vice versa. Sometimes I don't need either.
Beta Was this translation helpful? Give feedback.
All reactions