问题描述:今天在使用Crypto.Random.random的时候出现错误,具体错误原因如下:

>>> from Crypto.Random import random
Traceback (most recent call last):File "<stdin>", line 1, in <module>File "C:\Users\一\AppData\Local\Programs\Python\Python37\lib\site-packages\Crypto\Random\__init__.py", line 28, in <module>from Crypto.Random import OSRNGFile "C:\Users\一\AppData\Local\Programs\Python\Python37\lib\site-packages\Crypto\Random\OSRNG\__init__.py", line 34, in <module>from Crypto.Random.OSRNG.nt import newFile "C:\Users\一\AppData\Local\Programs\Python\Python37\lib\site-packages\Crypto\Random\OSRNG\nt.py", line 28, in <module>import winrandom
ModuleNotFoundError: No module named 'winrandom'

根据查询方法,修改import  winrandom为from Crypto.Random.OSRNG import winrandom (Crypto/Random/OSRNG/nt.py)

pip3 install Crypto

运行仍然报错无法解决问题,最终解决办法为:

安装的是pycrypto这个第三方库在使用这个函数的时候会报上面的错误。

想要解决winrandom这个错误可以安装pycryptodome这个第三方库,他的使用方法和pycrypto一样

pip install pycryptodome

python使用from Crypto.Random import random时候出现winrandom导入失败的解决方法相关推荐

  1. 成功解决tempfile.pyquot;, from random import Random as _Random ImportError: cannot import name 'Random

    成功解决tempfile.py",  from random import Random as _Random ImportError: cannot import name 'Random ...

  2. python无法安装pycurl_Python安装pycurl失败的解决方法

    Centos安装pycurl centos 安装pycurl yum install python-devel curl-devel pip3 install pycurl Mac(老版本)安装pyc ...

  3. python scipy安装失败的解决方法

    python scipy安装失败的解决方法 from scipy.misc import imreadTraceback (most recent call last):File "D:/P ...

  4. python安装pyecharts失败_Python中pyecharts安装及安装失败的解决方法

    pyecharts 是一个用于生成 Echarts 图表的类库.Echarts 是百度开源的一个数据可视化 JS 库.这篇文章重点给大家介绍pyecharts安装失败的处理方法,具体详情如下: pye ...

  5. Python ssh连接Linux服务器报Incompatible ssh peer (no acceptable kex algorithm) 解决方法

    Python ssh连接Linux服务器报Incompatible ssh peer (no acceptable kex algorithm) 解决方法 参考文章: (1)Python ssh连接L ...

  6. Python 下载依赖包环境经常失败超时解决方法

    Python 下载依赖包环境经常失败超时解决方法 参考文章: (1)Python 下载依赖包环境经常失败超时解决方法 (2)https://www.cnblogs.com/boonya/p/11909 ...

  7. c++中调用python脚本提示 error LNK2001: 无法解析的外部符号 __imp_Py_Initialize等错误的解决方法

    c++中调用python脚本提示 error LNK2001: 无法解析的外部符号 __imp_Py_Initialize等错误的解决方法 时间:2017-05-09 12:32:06阅读:234评论 ...

  8. react 中使用import()实现按需加载报错 解决方法 --‘import’ and ‘export’ may only appear at the top level

    react 中使用import()实现按需加载报错 解决方法 --'import' and 'export' may only appear at the top level 参考文章: (1)rea ...

  9. python读取和写入excel里面的数据(附int变float解决方法)

    python读取和写入excel里面的数据(附int变float解决方法) 参考文章: (1)python读取和写入excel里面的数据(附int变float解决方法) (2)https://www. ...

最新文章

  1. Java的多态(详尽版)
  2. C/C++求职宝典21个重点笔记(常考笔试面试点)
  3. STL之七:STL各种容器的使用时机详解(精讲大全)
  4. [html] 对一个元素设置浮动后,它的特征是什么?
  5. C++ —— C++类
  6. mysql 递归查找父节点_MYSQL递归查询所有父节点
  7. 搜狗输入法为什么按空格出字 搜狗输入法按空格出字怎么设置
  8. Oracle修改globalname,oracle修改global_name和service_name
  9. 如何高效检查一个数组中是否包含某个值?
  10. Activemq判断队列存活脚本(一)
  11. C++中默认选中预编译头#includestdafx.h作用
  12. linux机器光口和电口的区别,易天光通信SFP电口模块和10G SFP+电口模块介绍
  13. java中String stringBuffer StringBuider
  14. php excel数据导出
  15. HDU 1730 Northcott Game
  16. c语言函数实现数组输入输出
  17. 服务器如何查询网站域名备案号,如何查询域名备案号
  18. mac php7 mysql.so_[安装] mac安装PHP7经历
  19. net::ERR_ABORTED 404 (Not Found)错误
  20. 如何编写makefile

热门文章

  1. MATLAB与最小二乘法拟合数据
  2. 《天地有情》,太烂了!
  3. java-net-php-python-jsp旅行社信息管理系统计算机毕业设计程序
  4. 南京大学量子计算机陈教授,南京大学马小松: 潜心走入量子世界
  5. 在遭到勒索软件攻击时_勒索软件海啸在这里不要成为受害者
  6. 希腊字母 - 开发中常用的系统/服务名 - 收集
  7. 全球及中国金属包装市场发展状况与竞争趋势研究报告2022版
  8. 使用 Google 照片捕捉特殊视频时刻
  9. 【HUAWEI】初步认识 ENSP
  10. Android Java 代码检索工具Codota