Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import error: no module named dependencies #347

Closed
ZnoorZ opened this issue Aug 24, 2018 · 13 comments
Closed

Import error: no module named dependencies #347

ZnoorZ opened this issue Aug 24, 2018 · 13 comments

Comments

@ZnoorZ
Copy link

ZnoorZ commented Aug 24, 2018

Heads up! Edited on October 24, 2018

This issue comes up on google searches when folks haven't installed the necessary packages to run Dash.
If you find yourself here, then please visit the official installation instructions here: https://dash.plot.ly/installation
Thank you 🙇

Hi,
I am trying to run this code: usage-editable.py exactly as it is. I've completed the installation carefully : dash installation but I am getting this error :
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line72, in _run_code
exec code in run_globals
File "/myfolder/../usage-editable.py", line 1, in
import dash
File "dash.py", line 5, in
ImportError: No module named dependencies

Can't figure out how to resolve this issue.

@ned2
Copy link
Contributor

ned2 commented Aug 24, 2018

The source of the error is a failed import in the file dash.py, where it can't find the module dependencies. The strange thing about this is that the current version of Dash (and no release for some time, looking at a versions back) does not have the dependencies import line until some lines beyond line 5. Do you happen to have another file named 'dash' somewhere in the current folder you're working from? If you do, that could explain it. Try moving/renaming that file and running again.

@ZnoorZ
Copy link
Author

ZnoorZ commented Aug 25, 2018 via email

@ZnoorZ
Copy link
Author

ZnoorZ commented Aug 25, 2018 via email

@chriddyp
Copy link
Member

chriddyp commented Aug 25, 2018

Have you installed all of the libraries? https://dash.plot.ly/installation

@ZnoorZ
Copy link
Author

ZnoorZ commented Aug 26, 2018 via email

@chriddyp
Copy link
Member

chriddyp commented Aug 26, 2018

I'm assuming that the issue is that pip is installing them to a different place than the python installation that you are using. I'd try these two options:

  1. Option 1 - Use this explicit method of calling pip:
python -m pip install dash
python -m pip install dash-renderer
python -m pip install dash-core-components
python -m pip install dash-html-components
python -m pip install plotly
python app.py
  1. Alternatively, create a new virtualenv and use that virtualenv. This way, you can be sure where your python packages are getting installed:
virtualenv venv
source venv/bin/activate
pip install dash==0.24.1
pip install dash-renderer==0.13.0
pip install dash-html-components==0.11.0
pip install dash-core-components==0.27.1
pip install plotly --upgrade
python app.py

@ZnoorZ
Copy link
Author

ZnoorZ commented Aug 26, 2018

Sorry, I should have mentioned earlier I am getting this error inside my docker project. I tried to run a file with dash imports outside my docker project, it didn't give such error. I have this line in Dockerfile: "RUN pip install -r requirements.txt" and all the above packages in requirements.txt. What should I do about it?

@chriddyp
Copy link
Member

ah ok. i’m not sure, but this seems more like an issue with managing dependencies in docker rather than an issue with dash. we don’t do anything particular in our python distribution, so this sounds like a more generic issue outside the scope of this project.

@MAHIMACHANDWANI2125
Copy link

hey,I'm getting the same error

no module named dash.depedencies

I have installed the latest version too and tried all the methods you have listed above but still getting this error @chriddyp @ned2 @ZnoorZ @josegonzalez @nicolaskruchten @

@ned2
Copy link
Contributor

ned2 commented Dec 4, 2020

@MAHIMACHANDWANI2125, can you post the output of pip freeze and also the sequence of commands you used to install Dash?

@MAHIMACHANDWANI2125
Copy link

I used the commands above given by @chriddyp
and its showing this

Traceback (most recent call last):
  File "ddl", line 9, in <module>
    from dash.depedencies import Input,Output,State
ModuleNotFoundError: No module named 'dash.depedencies'

@ned2
Copy link
Contributor

ned2 commented Dec 5, 2020

The way of installing dash has installed has changed. You now simply want to create and activate a fresh virtual environment and then run:

pip install dash

If you're still experiencing issues, I'd recommend posting on the Dash community forum, as it's the place to go for technical support.

AnnMarieW pushed a commit to AnnMarieW/dash that referenced this issue Jan 6, 2022
Fixed wrong npm script name in README.md
@OviDaz17
Copy link

OviDaz17 commented Apr 8, 2022

tenia el mismo error y la solución fue borrar un archivo que había nombrado como Dash.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants