tphack:master !2 ?2 > python3 app.py
Traceback (most recent call last):
File "/Users/tien.phan/Documents/github/dashboard/app/app.py", line 7, in <module>
import dash_bootstrap_components as dbc
ModuleNotFoundError: No module named 'dash_bootstrap_components'
It was perfectly installed
tphack:master !2 ?2 > pip install dash-bootstrap-components
Requirement already satisfied: dash-bootstrap-components in /usr/local/lib/python3.11/site-packages (1.4.1)
However, when I run the app, I still got this error:
tphack:master !2 ?2 > python3 app.py
Traceback (most recent call last):
File "/Users/tien.phan/Documents/github/dashboard/app/app.py", line 7, in <module>
import dash_bootstrap_components as dbc
ModuleNotFoundError: No module named 'dash_bootstrap_components'
How to fix?
I install that package to user folder
tphack:master !2 ?2 > python -m pip install --user dash-bootstrap-components
python -m explaination: it will locate the module and execute its content as the __main__ module. This allows you to run a module directly from the command line.
tphack:master !2 ?3 > source ./env/bin/activate
tphack:master !2 ?3 > python -m pip install dash-bootstrap-components
Now it works
tphack:master !2 ?3 > python3 app.py py app at 16:00:37
Dash is running on http://0.0.0.0:8050/
INFO:dash.dash:Dash is running on http://0.0.0.0:8050/