最近另一个同事安装了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
这时候就可以正常运行了
网友评论