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

No module named 'flask.scaffold' #258

Closed
teletext78 opened this issue Jun 18, 2024 · 2 comments
Closed

No module named 'flask.scaffold' #258

teletext78 opened this issue Jun 18, 2024 · 2 comments

Comments

@teletext78
Copy link

Hello,

When running the software for the first time, I get this error:

pi@wordclock:~/rpi_wordclock/wordclock_config $ cd ~/rpi_wordclock
sudo python3 wordclock.py
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/flask_restx/api.py", line 21, in
from flask.helpers import _endpoint_from_view_func
ImportError: cannot import name '_endpoint_from_view_func' from 'flask.helpers' (/usr/local/lib/python3.9/dist-packages/flask/helpers.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/rpi_wordclock/wordclock.py", line 17, in
import wordclock_interfaces.web_interface as wciweb
File "/home/pi/rpi_wordclock/wordclock_interfaces/web_interface.py", line 4, i n
from flask_restx import Api, Resource, fields
File "/usr/local/lib/python3.9/dist-packages/flask_restx/init.py", line 5, in
from .api import Api # noqa
File "/usr/local/lib/python3.9/dist-packages/flask_restx/api.py", line 23, in
from flask.scaffold import _endpoint_from_view_func
ModuleNotFoundError: No module named 'flask.scaffold'

Any idea?

@teletext78
Copy link
Author

Problem solved:
I've installed Raspbian Bullseye lite on a RPi 1B using Raspberry Pi Imager.
To fix my issue, I had to install the following:

sudo pip3 install flask==2.0.2
sudo pip3 install werkzeug==2.0.2

Sidenote:
with Raspbian Bookworm (latest distro at the moment of writting), when trying to run "sudo pip3 install", I always get the error message "error: externally-managed-environment", that's why I've installed Bullseye instead.

Hope this will help somebody else as well.

@oxivanisher
Copy link
Contributor

Concerning the sidenote: My PR #250 would solve this issue.

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

2 participants