You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Include dash_core_components, dash_html_components in setup.py install_requires? #433
Quick question about the suggested installation approach: I see in the user guide that the preferred approach is to install dash and the two component libraries separately. Is there a reason those libraries aren't included in the setup.pyinstall_requires section?
I ask because when I went to install dash my first instinct was just pip install dash. This gave me ModuleNotFoundError: No module named 'dash_core_components', so my next instinct was to clone the repo and pip install -r requirements.txt (since I thought there might be lots of missing dependencies and I didn't want to install them all by hand), which sent me down a rabbit hole leading to #14 and #18.
This is definitely not a big deal, but I think it might make for a smoother user experience if pip install dash just worked.
If you're amenable, I'm happy to open a PR for this.
I ask because when I went to install dash my first instinct was just pip install dash. This gave me ModuleNotFoundError: No module named 'dash_core_components',
Yikes! I wasn't aware of this. I thought that they were completely independent.
Is there a reason those libraries aren't included in the setup.py install_requires section?
I like keeping them separate for a couple of reasons:
Users do a import dash_core_components - if they didn't install it explicitly, they might wonder why or how they could do this. The fact that they can do this just by doing pip install dash is implicit. This probably doesn't bother many people besides me though 😄
It encourages awareness that these are separate, modular projects. One of the core principles of Dash is its plugin system and modular-based approach: dash_core_components and dash_html_components use the same plugin system that we make available to everyone. Installing the packages separately provides the user with a little bit of awareness about this. Now, in practice, everyone uses dash_core_components and dash_html_components, so I might be being too pendantic here as well.
In the installation guide, I also wanted to teach some awareness about versioning and changelogs. That's why we have pip install dash==0.28.5 rather than pip install dash. These packages are changing a lot and it's good for users to be aware of which version they are on and how they can learn about new features and bug fixes (changelog). This one I feel pretty strongly about and, through discussions in the community forum, I think users have a pretty good awareness about this.
All that being said, pip install dashshould just work!. I actually can't replicate your issue: I just created a fresh virtualenv and did a pip install dash and it worked:
Of course, if I try to do import dash_core_components, it won't work since it wasn't installed.
>>> import dash_core_components
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'dash_core_components'
And I suppose if my reflex was "oh, that seems broken" rather than "oh, of course, I need to install the package!", then I'd google the error message:
And then I'd see a bunch of issues, instead of installation instructions!
So, I understand your pain. Not everyone is going to go through our nice user guide chapter by chapter (https://dash.plot.ly/) (no matter how hard I try 😢 ). Many folks will first just find an example online and then attempt to run it.
So, now I'm conflicted. I really like our installation instructions (https://dash.plot.ly/installation) but not everyone ends up on that page when they get started with Dash. And if they don't end up on that page, then they might end up having a bad time.
To start, I'm going to update those issues that appear on google with installation instructions to prevent the rabbit hole. Maybe I'll add some text to dash.plot.ly/installation too with that error message, so that it ranks better on search engines.
I'll keep thinking about this in the meantime. Thank you very much for raising the issue @hinnefe2 and I'm sorry about the rabbit hole 🐰
Hey, thanks for the quick response! (I'm consistently blown away by how responsive you all are on the dash team).
There's a slight miscommunication here (which is my fault): pip install dash does run without errors, it's just when I go to run a dash app (eg the Hello World example) that I get theModuleNotFoundError. This is on me - the app does import both modules so it's clear why I need them (and I should have been more explicit in the initial report).
I think I just got tripped up by my own laziness here 😄, first trying pip install dash without reading the docs, then chasing a requirements.txt red herring because I was too lazy to manually install missing dependencies.
I think this last bit speaks to your second bullet point (about these being separate, modular projects). In my mind the component libraries were dependencies because I'd never seen a Dash app without them. So when they were missing I thought other "dependencies" might be missing and went looking for requirements.txt. Your arguments make sense though so I'm happy to close this.
Activity
chriddyp commentedon Oct 24, 2018
Yikes! I wasn't aware of this. I thought that they were completely independent.
I like keeping them separate for a couple of reasons:
import dash_core_components- if they didn't install it explicitly, they might wonder why or how they could do this. The fact that they can do this just by doingpip install dashis implicit. This probably doesn't bother many people besides me though 😄dash_core_componentsanddash_html_componentsuse the same plugin system that we make available to everyone. Installing the packages separately provides the user with a little bit of awareness about this. Now, in practice, everyone usesdash_core_componentsanddash_html_components, so I might be being too pendantic here as well.pip install dash==0.28.5rather thanpip install dash. These packages are changing a lot and it's good for users to be aware of which version they are on and how they can learn about new features and bug fixes (changelog). This one I feel pretty strongly about and, through discussions in the community forum, I think users have a pretty good awareness about this.All that being said,
pip install dashshould just work!. I actually can't replicate your issue: I just created a fresh virtualenv and did apip install dashand it worked:Of course, if I try to do
import dash_core_components, it won't work since it wasn't installed.And I suppose if my reflex was "oh, that seems broken" rather than "oh, of course, I need to install the package!", then I'd google the error message:

And then I'd see a bunch of issues, instead of installation instructions!
So, I understand your pain. Not everyone is going to go through our nice user guide chapter by chapter (https://dash.plot.ly/) (no matter how hard I try 😢 ). Many folks will first just find an example online and then attempt to run it.
So, now I'm conflicted. I really like our installation instructions (https://dash.plot.ly/installation) but not everyone ends up on that page when they get started with Dash. And if they don't end up on that page, then they might end up having a bad time.
To start, I'm going to update those issues that appear on google with installation instructions to prevent the rabbit hole. Maybe I'll add some text to
dash.plot.ly/installationtoo with that error message, so that it ranks better on search engines.I'll keep thinking about this in the meantime. Thank you very much for raising the issue @hinnefe2 and I'm sorry about the rabbit hole 🐰
chriddyp commentedon Oct 24, 2018
Just to follow up, I've edited the top comment of #82, #29, #347, #14, #18, #25 with a note to refer folks to the installation instructions.
hinnefe2 commentedon Oct 24, 2018
Hey, thanks for the quick response! (I'm consistently blown away by how responsive you all are on the
dashteam).There's a slight miscommunication here (which is my fault):
pip install dashdoes run without errors, it's just when I go to run a dash app (eg the Hello World example) that I get theModuleNotFoundError. This is on me - the app does import both modules so it's clear why I need them (and I should have been more explicit in the initial report).I think I just got tripped up by my own laziness here 😄, first trying
pip install dashwithout reading the docs, then chasing arequirements.txtred herring because I was too lazy to manually install missing dependencies.I think this last bit speaks to your second bullet point (about these being separate, modular projects). In my mind the component libraries were dependencies because I'd never seen a Dash app without them. So when they were missing I thought other "dependencies" might be missing and went looking for
requirements.txt. Your arguments make sense though so I'm happy to close this.Thanks again, and sorry for the confusion!