报错:CryptographyDeprecationWarning

代码引用:

import paramiko
client = paramiko.SSHClient()
client.connect(serverIp, port=serverPort, username=serverUser)

报警告如下:

paramiko\ecdsakey.py:164: CryptographyDeprecationWarning: Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point
self.ecdsa_curve.curve_class(), pointinfo
paramiko\kex_ecdh_nist.py:39: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
m.add_string(self.Q_C.public_numbers().encode_point())
paramiko\kex_ecdh_nist.py:96: CryptographyDeprecationWarning: Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point
self.curve, Q_S_bytes
paramiko\kex_ecdh_nist.py:111: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
hm.add_string(self.Q_C.public_numbers().encode_point())

原因

paramiko 2.4.2 依赖 cryptography,而最新的cryptography==2.5里有一些弃用的API。

解决

删掉cryptography 2.5,安装2.4.2,就不会报错了。

pip uninstall cryptography==2.5
pip install cryptography==2.4.2

补充

paramiko的issue #1369提到了这个问题,并已有PR #1379了,尚未合并。

Python paramiko安装报错的更多相关文章

  1. Python——pip安装报错:is not a supported wheel on this platform

    pip安装报错:is not a supported wheel on this platform 可能的原因1:安装的不是对应python版本的库,下载的库名中cp35代表python3.5,其它同 ...

  2. python 首次安装 报错

    最近python很火,想在空余时间学习一波,但是安装完Python后运行发现居然报错了,错误代码是0xc000007b,于是通过往上查找发现是因为首次安装Python缺乏VC++库的原因 错误提示如下 ...

  3. python模块安装报错大全

    报错 环境 解决 手动安装pip install mysqlclient 报错: _mysql.c(29) : fatal error C1083: Cannot open include file: ...

  4. python pip安装报错python setup.py egg_info failed with error code 1

    安装locust遇到点问题折腾了好一会儿,记录一下. 使用命令pip install locustio提示python setup.py egg_info  failed with error cod ...

  5. python Twisted安装报错

    系统 mac pro 错误信息: IOError: [Errno 63] File name too long: '/var/folders/72/byjy11cs0dj_z3rjtxnj_nn000 ...

  6. python模块安装报错 :error: command 'gcc' failed with exit status 1

    参考:http://blog.csdn.net/fenglifeng1987/article/details/38057193 解决方法 yum install gcc libffi-devel py ...

  7. python pip安装报错: ConnectTimeoutError

    错误: 解决方案:  使用镜像:pip install xxxx -i https://pypi.douban.com/simple  如:pip3 install --upgrade tensorf ...

  8. 使用pip安装报错的处理方法

    在新的机子上使用pip安装程序一直报错: Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connect ...

  9. Scrapy安装报错

    python3 pip 安装Scrapy在win10 安装报错error: Microsoft Visual C++ 14.0 is required. Get it with "Micro ...

随机推荐

  1. 使用jackson转换xml格式数据进行响应

    最近在做微信扫码支付的功能,按照微信开发文档与支付平台进行数据交互只能使用XML格式的数据,调用别人定义的接口就需要按规则来嘛,没办法.自己之前使用jackson,主要是因为SpringMVC默认将j ...

  2. k8s 相关的命令

    查看node信息 kubectl describe node k8s-node- 查看dashboard token kubectl describe pod kubernetes-dashboard ...

  3. 【IntelliJ IDEA学习之七】maven专题

    版本:IntelliJIDEA2018.1.4 一.maven全局设置 设置Runner 运行VM参数:-Xms128m -Xmx512m -Duser.language=zh -Dfile.enco ...

  4. Appium Grid并发测试

    背景 Selenium玩的比较6的同学比较清楚:在Selenium中三大组件中有包含了Selenium Grid,而其作用就是分布式执行测试用例.主要的应用场景在于: 缩短测试执行时间,提高自动化测试 ...

  5. | C语言I作业04

    | C语言I作业004 标签: 18软件 李煦亮 问题 答案 这个作业属于那个课程 C语言程序设计II 这个作业要求在哪里 https://www.cnblogs.com/pengchen511/p/ ...

  6. NVDLA软件架构和源码解析 第一章—内核驱动【华为云技术分享】

    驱动整体设计介绍 不同的processor Nvidia DLA的内核驱动KMD(Kernel mode driver)中,并不是把DLA当成一个设备来控制,而是把不同的功能模块当做不同的proces ...

  7. 50道Redis面试题及答案整理,史上最全!

    在网上看到有关Redis的50道面试题,但是没有给出答案,之前我也在寻找这份Redis面试题的答案,今天特地把答案分享出来. 花了大量时间整理了这套Redis面试题及答案,希望对大家有帮助哈~ 弄明白 ...

  8. C#读写设置修改调整UVC摄像头画面-焦点

    有时,我们需要在C#代码中对摄像头的焦点进行读和写,并立即生效.如何实现呢? 建立基于SharpCamera的项目 首先,请根据之前的一篇博文 点击这里 中的说明,建立基于SharpCamera的摄像 ...

  9. C# vb .net图像合成-合成矩形

    在.net中,如何简单快捷地实现图像合成呢,比如合成文字,合成艺术字,多张图片叠加合成等等?答案是调用SharpImage!专业图像特效滤镜和合成类库.下面开始演示关键代码,您也可以在文末下载全部源码 ...

  10. Mycat分布式数据库架构解决方案--搭建MySQL读写分离环境--一主多从

    echo编辑整理,欢迎转载,转载请声明文章来源.欢迎添加echo微信(微信号:t2421499075)交流学习. 百战不败,依不自称常胜,百败不颓,依能奋力前行.--这才是真正的堪称强大!!! 本文主 ...