windows7x64下python3.8.10环境下使用paramiko、time、bcrypt等模块出现的一些错误

win7x64的补丁要更新,我这用的是腾讯电脑管家更新的;
  .net4之类的也装上;

版本:python3.8.10-amd64.exe

pip升级匹配的最新版命令:

python.exe -m pip install --upgrade pip

指定安装源安装: 

python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade pip

pip的官网如下:

https://pypi.org/   

pip 是 Python 中的标准库管理器。

管理顾名思义就是安装、删除、查询等。

pip --version 查看 pip 版本和所在的路径

 

 bug报错处理:

 paramiko模块 报错:

from transport import SecurityOptions, Transport

原因:paramiko模块中的方法使用变化了,可以在pycharm中

cryptography报错:

当 from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions 时,会报错:

ImportError: DLL load failed while importing _rust: 

from cryptography.hazmat.primitives.ciphers import algorithms, Cipher, modes

解决:安装低版本的 cryptography (许多次尝试不同版本)

pip install cryptography==41.0.2

博客原文引用: 

解决cryptography库报错【DLL load failed while importing _rust】_dll load failed while importing cufft-CSDN博客

报错:

ImportError: DLL load failed while importing _bcrypt: 找不到指定的程序

重新pip uninstall和install之后依旧报错。后降低版本为bcrypt为4.1.1,解决。

pip install bcrypt==4.1.1

 原文参考:

【Fix】ImportError: DLL load failed while importing _bcrypt: 找不到指定的程序。_dll load failed while importing ——bcrypt-CSDN博客

 报错:

ValueError: embedded null byteicon-default.png?t=N7T8http://quantnote.com/how-to-fix-value-error-embedded-null-byte-error.html 

旧:date = time.strftime("%Y年%m月%d日%H时%M分%S秒", time.localtime())        

新:date = time.strftime("%Y{}%m{}%d{}%H{}%M{}%S{}", time.localtime()).format("年", "月", "日", "时", "分", "秒"),参考链接:2、time — Time access and conversions — Python 3.8.19 documentationicon-default.png?t=N7T8https://docs.python.org/3.8/library/time.html#time.strftime 2、Python 日期时间格式化输出,带年、月、日、时、分、秒_python日期格式化输出-CSDN博客文章浏览阅读3.1w次,点赞13次,收藏66次。这篇博客介绍了如何使用Python的time模块进行日期和时间的格式化。通过实例展示了如何输出当前时间,并解释了在格式化字符串中使用特定字符的限制。同时,针对无法直接传入汉字的问题,提供了使用格式化字符串方法来解决。还分享了一个封装好的函数`ftime()`,它支持不同的参数输出不同格式的时间字符串,包括纯数字形式、常规格式和中文日期格式。https://blog.csdn.net/zhouyinlong1990/article/details/122289029 另外一个openpyxl模块的参考(原因是execl的文件名错了):

pandas读取Excel核心源码剖析,面向过程仿openpyxl源码实现Excel数据加载

至此,在windows7x64下运行python3.8.10的paramiko和openyxl、time模块的bug全部解决了。

 

 

  • 16
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值