databricks:cryptographydepractionwarning:python3.5支持将在下一个加密版本中被放弃

30byixjq  于 2021-07-12  发布在  Spark
关注(0)|答案(1)|浏览(260)

我使用的是databricks cluster 5.5 lts版本。最初,我是在Python2中使用它的。但是现在我已经从python2升级到了python3,保持集群版本不变。我已经安装了库pgpy来执行python中pgp文件的解密。但是,由于这次升级,一个scala笔记本(在这次升级之前运行得非常好)出现了以下错误:

org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 1.0 failed 4 times, most recent failure: Lost task 0.3 in stage 1.0 (TID 7, 10.139.64.4, executor 2): org.apache.spark.SparkException: Process List(/databricks/python/bin/pip, install, xlrd, --disable-pip-version-check) exited with code 1. /databricks/python3/lib/python3.5/site-packages/OpenSSL/_util.py:6: CryptographyDeprecationWarning: Python 3.5 support will be dropped in the next release of cryptography. Please upgrade your Python.

如何解决此错误?

vsdwdz23

vsdwdz231#

你有几个选择:
关闭警告(有多种方法)

import warnings

# Ignores only DeprecationWarningS (not recommended)

warnings.filterwarnings('ignore', category=DeprecationWarning)

# Ignores all WarningS (not recommended, worse than above)

export PYTHONWARNINGS='ignore'

升级python 3.5(首选)
将pgpy恢复到仍然支持python3.5的早期版本
最终,您将把python升级到受支持的版本,实际上,python3.5已经过时了;它和3.6之间甚至有显著的变化。而且,这样做很重要,因为这涉及到openssl。让它过时是不明智的。
看一看这个 warnings 模块文档以获取有关抑制它们的详细信息。

相关问题