美文网首页
安装PyCrypto以后出现的错误

安装PyCrypto以后出现的错误

作者: 小小看护 | 来源:发表于2018-07-30 15:33 被阅读957次

最近另一个同事安装了PyCrypto,并且在本地和服务器运行都没有错误。当我download下来的时候,安装PyCrypto,运行竟然出现了错误。如下:

homeassistant  | 16-07-01 18:35:24 ERROR (MainThread) [homeassistant.bootstrap] Error during setup of component wink
homeassistant  | Traceback (most recent call last):
homeassistant  |   File "/usr/src/app/homeassistant/bootstrap.py", line 150, in _setup_component
homeassistant  |     if not component.setup(hass, config):
homeassistant  |   File "/usr/src/app/homeassistant/components/wink.py", line 29, in setup
homeassistant  |     from pubnub import Pubnub
homeassistant  |   File "/usr/local/lib/python3.4/site-packages/pubnub.py", line 25, in <module>
homeassistant  |     from Crypto.Cipher import AES
homeassistant  |   File "/usr/local/lib/python3.4/site-packages/Crypto/Cipher/__init__.py", line 78, in <module>
homeassistant  |     from Crypto.Cipher._mode_ecb import _create_ecb_cipher
homeassistant  |   File "/usr/local/lib/python3.4/site-packages/Crypto/Cipher/_mode_ecb.py", line 29, in <module>
homeassistant  |     from Crypto.Util._raw_api import (load_pycryptodome_raw_lib,
homeassistant  |   File "/usr/local/lib/python3.4/site-packages/Crypto/Util/_raw_api.py", line 33, in <module>
homeassistant  |     from Crypto.Util.py3compat import byte_string
homeassistant  | ImportError: cannot import name 'byte_string'

解决办法是

pip3 uninstall pycrypto
pip3 uninstall pycryptodome
pip3 install pycryptodome

这时候就可以正常运行了

相关文章

网友评论

      本文标题:安装PyCrypto以后出现的错误

      本文链接:https://www.haomeiwen.com/subject/zgefvftx.html