2017-10-08 55 views
4

您好,我阅读了Django tutorials,并且我在迁移过程中遇到了与特定sha3_224散列函数有关的错误。如何解决这个问题呢?谢谢。使用python3.6 Django迁移错误:root:未找到散列sha3_224的代码

(venv) [email protected]:~/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 
+0

当试图使用Django频道时,我大致得到这个堆栈跟踪,降级或重新创建虚拟env清除了这一点。有人能说Hashlib实际上是在获取这种编码吗?django在哪里试图使用它们?为什么降级或建立新的venv帮助? –

回答

11

检查您的python是否已被最近更新。 venv可能指向旧的,重新创建venv为我们固定它。

运行mkvirtualenv venvvirtualenv venv(取决于您如何创建它)也应该在保持安装的包的同时工作。

3

此问题出现在新版本的python - 3.6.3中。

降级到3.6.2帮我

这里是传统的PPA:https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes/+index?batch=75&direction=backwards&start=75

+2

此外,同事们说virtualenv reinitilizing解决了这个问题,因为那里使用了旧的常见python库 –

+1

这发生在我升级到3.6.3后发生在我身上 与3.6.3重新创建virtualenv解决了问题 – tista3

+0

有人可以说为什么这个工程? –

0

这发生在我升级到3.6.3尽量创造新的virtualenv使用Python 3.6.3或更新版本之后。这解决了我的问题。

0

这解决了我的问题:

cd /usr/bin 
sudo cp python3.6 python3 

以前我有3.6.2,该系统被打破做apt-upgrade后。