I wanted to know if there was a way to install dash without plotly ?
(Or alternatively, a minimal version of plotly - I will not be using any plotting features)
The package size is too large because of plotly.
I couldn’t find any post about it, so please redirect me if I am missing something.
Hmm i think they are pretty well baked together. I guess you could try installing both then removing the individual dependencies but that’s just my non-tested guess.
Out of curiosity, can i ask why you only want dash without plotly?
dash has a plethora of features and community-made components (dbc, dmc) which are perfectly capable of making a non-data-based website. The most efficient way to do so? probably not, but its not that infeasible
I have made (and will continue to make) complex multi-page apps on Dash because I don’t really want to learn a js framework, as I am not a web developer, and it is so easy to do on Dash.
Hmm, but just uninstalling plotly results in the following traceback:
Traceback (most recent call last):
File "main.py", line 1, in <module>
import dash
File "misc\lib\site-packages\dash\__init__.py", line 22, in <module>
from ._callback import callback, clientside_callback # noqa: F401,E402
File "misc\lib\site-packages\dash\_callback.py", line 35, in <module>
from .long_callback.managers import BaseLongCallbackManager
File "misc\lib\site-packages\dash\long_callback\__init__.py", line 1, in <module>
from .managers.celery_manager import ( # noqa: F401,E402
File "misc\lib\site-packages\dash\long_callback\managers\celery_manager.py", line 5, in <module>
from _plotly_utils.utils import PlotlyJSONEncoder
ModuleNotFoundError: No module named '_plotly_utils'
I think the only way to fix this is just to delete the parts from the plotly library that are not necessary. This process will be trial and error. Go into the plotly folder in your virtual environment, delete a folder and see if your app still works. Note down the folders that you are allowed to delete, so that you can build a script later to automatically delete the unnecessary folders after you updated plotly to a later version. If you are not allowed to delete a folder, you can go in the folder and start deleting subfolders.
One thing I noticed is that there is a jupyterlab_plotly folder that also gets installed. Most likely this one can also be removed.
If you do decide to sit down for this, consider sharing your results here, I would be very interested to see them.