from flask import jsonify
from flask import flash, request
from werkzeug import generate_password_hash, check_password_hash
Error Please help me to fix these issues I have tried with pip install Werkzeug But not working
Traceback (most recent call last): File "server.py", line 6, in from werkzeug import generate_password_hash, check_password_hash ImportError: cannot import name 'generate_password_hash'
Name error is raised when the system cannot identify the variables used. So, today in this article, we have seen the main reasons for ImportError: Cannot Import Name. We have seen the concept of circular dependency and how it affects our code.
The imported module is not imported. The imported module is not created. Module or Class names are misspelled. Or, the imported class is in circular dependency. There may be more scenarios in which the importerror occurs. But in this article, we will only focus on the last one, i.e.,
DeprecationWarning: The import 'werkzeug.generate_password_hash' is deprecated and will be removed in Werkzeug 1.0.
Here, the error occurs as Python is unable to import ImageTK. Now, the reason behind the error is unknown, but you can solve it by importing them separately using the following command. Check the __init__.py at root dir. Openpyxl read this information from the .constrants.JSON file.
You can try
from werkzeug.security import generate_password_hash, check_password_hash
or check the version of werkzeug installed in your system. Those functions are available for version 1.0.x
Those functions were deprecated for a while and now they are moved to werkzeug.security
DeprecationWarning: The import 'werkzeug.generate_password_hash' is deprecated and will be removed in Werkzeug 1.0. Use 'from werkzeug.security import generate_password_hash' instead.
from werkzeug import generate_password_hash, check_password_hash
DeprecationWarning: The import 'werkzeug.check_password_hash' is deprecated and will be removed in Werkzeug 1.0. Use 'from werkzeug.security import check_password_hash' instead.
from werkzeug import generate_password_hash, check_password_hash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With