web-dev-qa-db-fra.com

Migration Django avec python3.6 ERREUR: root: code pour hash sha3_224 introuvable

Bonjour, j'ai lu Didacticiels Django et j'ai une erreur liée à la fonction de hachage sha3_224 au cours du processus de migration. Comment résoudre ce problème? Je vous remercie.

(venv) linuxoid@linuxoid-ThinkPad-L540:~/myprojects/myproject$ python manage.py makemigrations
ERROR:root:code for hash sha3_224 was not found.
Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 121, in __get_openssl_constructor
    f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_sha3_224'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 243, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 128, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha3_224
ERROR:root:code for hash sha3_256 was not found.
Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 121, in __get_openssl_constructor
    f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_sha3_256'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 243, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 128, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha3_256
ERROR:root:code for hash sha3_384 was not found.
Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 121, in __get_openssl_constructor
    f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_sha3_384'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 243, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 128, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha3_384
ERROR:root:code for hash sha3_512 was not found.
Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 121, in __get_openssl_constructor
    f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_sha3_512'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 243, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 128, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha3_512
ERROR:root:code for hash shake_128 was not found.
Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 121, in __get_openssl_constructor
    f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_shake_128'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 243, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 128, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type shake_128
ERROR:root:code for hash shake_256 was not found.
Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 121, in __get_openssl_constructor
    f = getattr(_hashlib, 'openssl_' + name)
AttributeError: module '_hashlib' has no attribute 'openssl_shake_256'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 243, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 128, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/home/linuxoid/myprojects/venv/lib/python3.6/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type shake_256
No changes detected

Cela a résolu mon problème:

cd /usr/bin
Sudo cp python3.6 python3

Auparavant, j'avais 3.6.2, après apt-upgrade, le système était en panne.

2
Dede

Vérifiez si votre python a été mis à jour récemment. Il se peut que le venv pointe du doigt l’ancien, en recréant ce qu’il a corrigé pour nous.

Exécuter mkvirtualenv venv ou virtualenv venv (en fonction de la manière dont vous l'avez créé) devrait également fonctionner tout en conservant les packages installés.

14
Michał Łazowik

! Attention, il est vraiment correctif!

Ce problème apparaît dans la nouvelle version de python - 3.6.3.

La rétrogradation à 3.6.2 m'a aidé

Voici un PPA hérité: https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes/+index?batch=75&direction=backwards&start=75

Commandes pour les actions ultérieures de downgrading python:

Sudo apt install libpython3.6-minimal=3.6.2-1+xenial1 Sudo apt install python3.6-minimal=3.6.2-1+xenial1 Sudo apt install python3.6-stdlib=3.6.2-1+xenial1 Sudo apt install python3.6=3.6.2-1+xenial1

4
Sergey Zakharov

Cela m'est arrivé après la mise à niveau vers la version 3.6.3. Essayez de créer virtualenv avec Python 3.6.3 ou une version plus récente. Cela a résolu le problème pour moi.

0
tista3