python使用from Crypto.Random import random时候出现winrandom导入失败的解决方法
问题描述:今天在使用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导入失败的解决方法相关推荐
- 成功解决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 ...
- python无法安装pycurl_Python安装pycurl失败的解决方法
Centos安装pycurl centos 安装pycurl yum install python-devel curl-devel pip3 install pycurl Mac(老版本)安装pyc ...
- python scipy安装失败的解决方法
python scipy安装失败的解决方法 from scipy.misc import imreadTraceback (most recent call last):File "D:/P ...
- python安装pyecharts失败_Python中pyecharts安装及安装失败的解决方法
pyecharts 是一个用于生成 Echarts 图表的类库.Echarts 是百度开源的一个数据可视化 JS 库.这篇文章重点给大家介绍pyecharts安装失败的处理方法,具体详情如下: pye ...
- Python ssh连接Linux服务器报Incompatible ssh peer (no acceptable kex algorithm) 解决方法
Python ssh连接Linux服务器报Incompatible ssh peer (no acceptable kex algorithm) 解决方法 参考文章: (1)Python ssh连接L ...
- Python 下载依赖包环境经常失败超时解决方法
Python 下载依赖包环境经常失败超时解决方法 参考文章: (1)Python 下载依赖包环境经常失败超时解决方法 (2)https://www.cnblogs.com/boonya/p/11909 ...
- c++中调用python脚本提示 error LNK2001: 无法解析的外部符号 __imp_Py_Initialize等错误的解决方法
c++中调用python脚本提示 error LNK2001: 无法解析的外部符号 __imp_Py_Initialize等错误的解决方法 时间:2017-05-09 12:32:06阅读:234评论 ...
- 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 ...
- python读取和写入excel里面的数据(附int变float解决方法)
python读取和写入excel里面的数据(附int变float解决方法) 参考文章: (1)python读取和写入excel里面的数据(附int变float解决方法) (2)https://www. ...
最新文章
- Java的多态(详尽版)
- C/C++求职宝典21个重点笔记(常考笔试面试点)
- STL之七:STL各种容器的使用时机详解(精讲大全)
- [html] 对一个元素设置浮动后,它的特征是什么?
- C++ —— C++类
- mysql 递归查找父节点_MYSQL递归查询所有父节点
- 搜狗输入法为什么按空格出字 搜狗输入法按空格出字怎么设置
- Oracle修改globalname,oracle修改global_name和service_name
- 如何高效检查一个数组中是否包含某个值?
- Activemq判断队列存活脚本(一)
- C++中默认选中预编译头#includestdafx.h作用
- linux机器光口和电口的区别,易天光通信SFP电口模块和10G SFP+电口模块介绍
- java中String stringBuffer StringBuider
- php excel数据导出
- HDU 1730 Northcott Game
- c语言函数实现数组输入输出
- 服务器如何查询网站域名备案号,如何查询域名备案号
- mac php7 mysql.so_[安装] mac安装PHP7经历
- net::ERR_ABORTED 404 (Not Found)错误
- 如何编写makefile