ITPub博客

首页 > > > No module named Crypto--转

No module named Crypto--转

作者:longmanma 时间:2020-01-10 17:50:13 0 删除 编辑

https://blog.csdn.net/lacoucou/article/details/53152122

背景:win10+python 2.7
在python 中使用AES算法时,会报告上述错误,原因是Crypto并非标准模块,需要自己单独安装。
安装方法:

1.pip install pycropt 这中办法经常会报错:

error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27

似乎也很麻烦。

2.使用编译好的安装包。下载地址:

  [pycropt](http://www.voidspace.org.uk/python/modules.shtml#pycrypto)

根据自己的版本现在对应的安装即可。

然而,安装完,或许并没有什么卵用,使用依旧报错:

No module named Crypto.Cipher

经过苦苦搜索,终于在stackover上找到答案: 
打开链接之后请拉到最后一条回答

I found the solution. Issue is probably in case sensitivity (on Windows). 
Just change the name of the folder: 
C:\Python27\Lib\site-packages\crypto 
to: C:\Python27\Lib\site-packages\Crypto

翻译过来就是: 
把crypto文件夹重命名为Crypto。 
终于可以正常使用了。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2730/viewspace-3132424/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: shell正则表达式-2
请登录后发表评论 登录
全部评论

注册时间:2019-12-18

  • 博文量
    492
  • 访问量
    12002