在Windows下安装crypto

pip3 install crypto

尝试导入crypto的对象时候出现错误,如下

>>> from Crypto.Cipher import AES
Traceback (most recent call last):
    File "<stdin>" , line 1, in <module>
NoduleNotFoundError: No module name 'Crypto'

经检查发现原因是crypto在python上面的名字是pycrypto,它是一个第三方库,但是已经停止更新三年了

解决方案是使用pycryptodome替换crypto

pip3 uninstall crypto
pip3 install pycryptodome

Windows还需额外一步操作,定位到Python的安装目录,找到Libsite-packages,将crypto文件夹重命名为Crypto(首字母改成大写)