2.9 on Ubuntu: cannot import name 'PasswordHasher' from 'argon2'

37 views
Skip to first unread message

Lucas Eichhorn

unread,
Jun 23, 2022, 11:53:18 PMJun 23
to mnemosyne-proj-users
Hi,
I downloaded the 2.9 version, created an environment in conda, and installed all required python packages as indicated in the Readme (pip install --upgrade PyQt5 PyQtWebEngine matplotlib cheroot webob pillow googletrans gTTS). When I start mnemosyne via commandline I get the following error message (twice):

An unexpected error has occurred.
Please forward the following info to the developers:

Traceback (innermost last):
  File "/home/lucas/forest/miniconda3/envs/mnemo/bin/mnemosyne", line 4, in <module>
    __import__('pkg_resources').run_script('Mnemosyne==2.9', 'mnemosyne')
  File "/home/lucas/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 656, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/lucas/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1453, in run_script
    exec(code, namespace, namespace)
  File "/home/lucas/forest/miniconda3/envs/mnemo/lib/python3.10/site-packages/Mnemosyne-2.9-py3.10.egg/EGG-INFO/scripts/mnemosyne", line 278, in <module>
    mnemosyne.initialise(data_dir=data_dir, filename=filename,
  File "/home/lucas/forest/miniconda3/envs/mnemo/lib/python3.10/site-packages/Mnemosyne-2.9-py3.10.egg/mnemosyne/libmnemosyne/__init__.py", line 411, in initialise
    self.register_components()
  File "/home/lucas/forest/miniconda3/envs/mnemo/lib/python3.10/site-packages/Mnemosyne-2.9-py3.10.egg/mnemosyne/libmnemosyne/__init__.py", line 476, in register_components
    importlib.import_module(module_name), class_name)
  File "/home/lucas/forest/miniconda3/envs/mnemo/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/lucas/forest/miniconda3/envs/mnemo/lib/python3.10/site-packages/Mnemosyne-2.9-py3.10.egg/mnemosyne/pyqt_ui/qt_sync_server.py", line 15, in <module>
    from mnemosyne.libmnemosyne.sync_server import SyncServer
  File "/home/lucas/forest/miniconda3/envs/mnemo/lib/python3.10/site-packages/Mnemosyne-2.9-py3.10.egg/mnemosyne/libmnemosyne/sync_server.py", line 9, in <module>
    from argon2 import PasswordHasher
 ImportError: cannot import name 'PasswordHasher' from 'argon2' (/home/lucas/forest/miniconda3/envs/mnemo/lib/python3.10/site-packages/argon2.py)

No idea what I should do and I'd love to try out 2.9. I'm also confused because in the argon2.py file there is no sign of a “PasswordHasher” …

Peter Bienstman

unread,
Jun 24, 2022, 5:46:12 AMJun 24
to mnemosyne-proj-users
Hi,

I think there must be something strange with your argon2 install. E.g., on my (Windows) system, I don't have a site-packages/argon2.py file, but rather a site-packages/argon2 directory with 8 python files and 1 compiled library, and where __init__.py lists PasswordHasher. FYI, I'm using argon2 20.1.0.

Hope this helps,

Peter

--
You received this message because you are subscribed to the Google Groups "mnemosyne-proj-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mnemosyne-proj-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mnemosyne-proj-users/9455d303-2673-4f44-91ce-085a7588784an%40googlegroups.com.

Lucas Eichhorn

unread,
Jun 26, 2022, 10:04:39 AMJun 26
to mnemosyne-proj-users
Whops, I installed argon2 instead of argon2-cffi which is the correct one.
Reply all
Reply to author
Forward
0 new messages