【问题标题】:Databricks: CryptographyDeprecationWarning: Python 3.5 support will be dropped in the next release of cryptographyDatabricks:CryptographyDeprecationWarning:Python 3.5 支持将在下一个密码学版本中删除
【发布时间】:2021-03-02 05:55:00
【问题描述】:

我正在使用 Databricks 集群 5.5 LTS 版本。最初,我将它与 Python 2 一起使用。但现在我已经从 Python 2 升级到了 3,保持集群版本相同。我已经安装了库 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.

我该如何解决这个错误?

【问题讨论】:

  • 您从过时的 Python 2.7 更新到过时的 Python 版本 3.5。

标签: python apache-spark databricks


【解决方案1】:

你有几个选择:

  • 关闭警告(有多种方法)
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 恢复到仍支持 Python 3.5 的先前版本

最终,您最终将 Python 升级到受支持的版本,实际上,Python 3.5 被认为已过时;它和 3.6 之间甚至有很大的变化。此外,这样做也很重要,因为这涉及 OpenSSL。让它过时是不明智的。

查看warnings 模块documentation 了解有关抑制它们的更多信息。

【讨论】:

    猜你喜欢
    • 2016-03-15
    • 2018-10-13
    • 2017-02-08
    • 2020-03-08
    • 2018-04-27
    • 1970-01-01
    • 1970-01-01
    • 2023-04-08
    • 1970-01-01
    相关资源
    最近更新 更多