Jump to content
  • 0

MCC 128 Issues with Web Server Example


keshmaster81

Question

I have my MCC 128 setup and tested with all the example sketches. The only one that doesn't work is the web server example. All I can see on the local host page is the title "Web Server Example".

These are the error messages that I get. The first few errors I replaced what it asked but that didn't fix anything. The other error stating " No such file or directory: '/usr/lib/python3/dist-packages/plotly/package_data/plotly.min.js'" I'm not sure about. I made sure dash, plotly and pandas were installed on my pi multiple times.

Any help here would be appreciated, thanks!

/usr/lib/python3/dist-packages/thonny/plugins/cpython_backend/cp_back.py:353: UserWarning: 
The dash_core_components package is deprecated. Please replace
`import dash_core_components as dcc` with `from dash import dcc`
  module = self._original_import(*args, **kw)
/usr/lib/python3/dist-packages/thonny/plugins/cpython_backend/cp_back.py:353: UserWarning: 
The dash_html_components package is deprecated. Please replace
`import dash_html_components as html` with `from dash import html`
  module = self._original_import(*args, **kw)
Dash is running on http://10.44.0.152:8080/

 * Serving Flask app 'web_server'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://10.44.0.152:8080
Press CTRL+C to quit
10.44.0.187 - - [06/Jun/2024 16:55:46] "GET / HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "GET /_dash-layout HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "GET /_dash-dependencies HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "GET /_favicon.ico?v=2.17.0 HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "POST /_dash-update-component HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "GET /_dash-component-suites/dash/dcc/async-graph.js HTTP/1.1" 304 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "GET /_dash-component-suites/dash/dcc/async-dropdown.js HTTP/1.1" 304 -
[2024-06-06 16:55:47,267] ERROR in app: Exception on /_dash-component-suites/plotly/package_data/plotly.min.js [GET]
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/dash/dash.py", line 1004, in serve_component_suites
    pkgutil.get_data(package_name, path_in_pkg), mimetype=mimetype
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/pkgutil.py", line 640, in get_data
    return loader.get_data(resource_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 1130, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3/dist-packages/plotly/package_data/plotly.min.js'
10.44.0.187 - - [06/Jun/2024 16:55:47] "GET /_dash-component-suites/plotly/package_data/plotly.min.js HTTP/1.1" 500 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "POST /_dash-update-component HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "POST /_dash-update-component HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "POST /_dash-update-component HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "POST /_dash-update-component HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "POST /_dash-update-component HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "POST /_dash-update-component HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "POST /_dash-update-component HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "POST /_dash-update-component HTTP/1.1" 200 -
10.44.0.187 - - [06/Jun/2024 16:55:47] "POST /_dash-update-component HTTP/1.1" 200 -

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I have a Raspberry PI 5 and successfully used Thonny with the webserver. 

Step 1.   Create a virtual environment with Tools->Options->New Virtual Environment

Step 2.  Use Tools->Manage Packages to install Dash and daqhats.

Step 3.  Load and run web_server.py.

Your errors could be due to your system being outdated. Try updating with:

sudo apt full-upgrade
sudo reboot

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...