Issue
The Plotly documentation says the following regarding Dash:
Dash is the best way to build analytical apps in Python using Plotly figures. To run the app below, run pip install dash, click "Download" to get the code and run python app.py.
However, when I type in "python app.py" it says "No such file or directory" at the location of my command prompt. Since I use Miniconda, I installed the package from conda-forge. Perhaps an environment variable is not being set with the Anaconda version, but I have not seen anyone else with this issue.
I searched the folder where Dash is installed, but there was no app.py. It looks like app.py is part of Flask, but running app.py in Flask's folder returned the following error:
AttributeError: partially initialized module 'logging' has no attribute 'Logger' (most likely due to a circular import).
I checked and made sure both Dash and Flask are installed.
My problem is similar to: Dash: Why is my dash application not working when running through command prompt?, but in that post, running "Python app.py" did nothing instead of saying the file wasn't found.
Any suggestions on how to solve this problem?
Solution
I think there is a misunderstanding here. On the page where you read the text you quoted, containing "to run the app below", there should have been a piece of code right below that. It should even include a Download button there, that will download the file app.py
(if not, paste the code into an empty file called app.py
). You can then open a command prompt in the directory containing that file and run it via python app.py
.
So, app.py
is not a standard command that gets enabled by installing plotly. It's rather the most commonly used name for single-file plotly apps, which you can run by calling them via python, if Dash
is installed. You could of course rename and call it with the new name, calling it app.py
is not mandatory.
Answered By - Michel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.