samba4-manager icon indicating copy to clipboard operation
samba4-manager copied to clipboard

ImportError: cannot import name 'TextField' from 'wtforms'

Open LinuxCuba opened this issue 2 years ago • 1 comments

I'm trying to run samba4-manager under debian 11 and samba4, and it throws a really weird error.


root@srv-dc01:~/samba4-manager-master# ./samba4-manager --config manager.cfg
Traceback (most recent call last):
  File "/root/samba4-manager-master/./samba4-manager", line 114, in <module>
    plugin = importlib.import_module("plugins.%s" % plugin_name)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/root/samba4-manager-master/plugins/user.py", line 22, in <module>
    from wtforms import PasswordField, SelectMultipleField, TextAreaField, \
ImportError: cannot import name 'TextField' from 'wtforms' (/usr/local/lib/python3.9/dist-packages/wtforms/__init__.py)

All dependencies and requirements were installed from pip without errors.

How to resolve this error. Thanks.

LinuxCuba avatar Jun 21 '22 17:06 LinuxCuba

Just downgrade your wtforms version

As a workaround run the following to remove 3.0 and replace with 2.3.3. the UI will launch after completed.

pip3 install WTForms==2.3.3

AndrewOcamps avatar Feb 22 '23 14:02 AndrewOcamps