报错: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. PyTorch学习之六个学习率调整策略

    PyTorch学习率调整策略通过torch.optim.lr_scheduler接口实现.PyTorch提供的学习率调整策略分为三大类,分别是 有序调整:等间隔调整(Step),按需调整学习率(Mul ...

  2. 收藏:png8和png24的根本区别

    1.png8和png24的根本区别,不是颜色位的区别,而是存储方式不同. 2.png8有1位的布尔透明通道(要么完全透明,要么完全不透明),png24则有8位(256阶)的布尔透明通道(所谓半透明). ...

  3. backend介绍

    开发环境: windows python django 2.2 一个django 后台管理的app 将后台管理组件化, 不依赖于项目, 只要简单配置就可以使用, 开发业务逻辑也非常方便 其主要包含三个 ...

  4. Maven 教程(18)— 利用 Profile 构建不同环境的部署包

    原文地址:https://blog.csdn.net/liupeifeng3514/article/details/79776257 接上回继续,项目开发好以后,通常要在多个环境部署,象我们公司多达5 ...

  5. Java中的数据类型与运算符

    一.变量的命名 (1)什么是变量:变量是java中存储数据的空间. (2)变量命名的规则:由:数(数字),字(字母),下(下划线),美(美元符号),人(人名币符号)组成的标识符.注:数字不能作为首字母 ...

  6. [转帖]智能合约和 DApp

    智能合约和 DApp https://www.jianshu.com/p/5e7df3902957 2018.10.08 19:50:41字数 3,403阅读 9,819 2017年11月份和2018 ...

  7. 简易版php文件上传_超详细详解

    1.php简化版的图片上传(没有各种验证) 1234 <form action="" enctype="multipart/form-data" meth ...

  8. GoCN每日新闻(2019-09-23)

    1. 查看 Go 的代码优化过程http://xargin.com/go-compiler-opt 2. go 学习笔记之仅仅需要一个示例就能讲清楚什么闭包 https://segmentfault. ...

  9. teacher笔记

    ======= 总览 start ======= 1.素质教育以提高国民素质为根本宗旨4.素质教育是促进学生个性发展的教育5.素质教育是以培养学生的创新精神和事件能力为重点的教育2.素质教育是面向全体 ...

  10. FusionInsight大数据开发---MapReduce与YARN应用开发

    MapReduce MapReduce的基本定义及过程 搭建开发环境 代码实例及运行程序 MapReduce开发接口介绍 1. MapReduce的基本定义及过程 MapReduce是面向大数据并行处 ...