【问题标题】:Installing Janitor library in Azure Databricks在 Azure Databricks 中安装 Janitor 库
【发布时间】:2021-10-07 02:43:04
【问题描述】:

我安装了 Python 3.7。 试图在Azure DataBricks 中安装janitor 库。它在我的本地机器上可以正常工作,但是在Azure DataBricks中安装有困难。

我运行dbutils.library.installPyPI('janitor'),但收到以下错误: ModuleNotFoundError: No module named 'ConfigParser'。正如“https://stackoverflow.com/questions/14087598/python-3-importerror-no-module-named-configparser”中所述,我尝试了butils.library.installPyPI('mysqlclient'),但没有成功。

【问题讨论】:

  • 你安装ConfigParser了吗?
  • 我做了Requirement already satisfied: ConfigParser in /databricks/python3/lib/python3.7/site-packages (5.0.2),但是当我运行import janitor时它给了我同样的错误ModuleNotFoundError: No module named 'ConfigParser'

标签: python azure-databricks


【解决方案1】:

dbutils.library.installPyPI 是一种已弃用的方法 (doc)。您需要改用%pip install janitor(请参阅docs

【讨论】:

  • 我做了%sh pip install janitor,但仍然显示错误。我也运行%pip install janitor,但它给了我org.apache.spark.SparkException: Conda and pip magic commands are currently not supported in Databricks. To modify the environment on driver only, you can use %sh.
  • 什么 DBR 版本?
  • DBR 6.4、Spark 2.4.5、Scala 2.11
【解决方案2】:

您可以使用 %pip install janitor 安装 Janitor 库。

根据您的 Databricks Runtime,如果您无法使用上述命令进行安装,您可以使用任何替代方法安装库:different methods to install packages in Azure Databricks

【讨论】:

  • 它给了我ModuleNotFoundError: No module named 'ConfigParser',但是我运行%sh pip install ConfigParser。似乎ConfigParser 已安装为Collecting ConfigParser Using cached https://files.pythonhosted.org/packages/fd/01/ff260a18caaf4457eb028c96eeb405c4a230ca06c8ec9c1379f813caa52e/configparser-5.0.2-py3-none-any.whl Installing collected packages: ConfigParser Successfully installed ConfigParser-5.0.2 You should consider upgrading via the 'pip install --upgrade pip' command.,但没有。我仍然收到ModuleNotFoundError: No module named 'ConfigParser'
  • @AmnKh 你能分享一下你正在使用的 Databricks Runtime 吗?
猜你喜欢
  • 1970-01-01
  • 2019-08-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-06-09
  • 2020-05-25
  • 2019-02-22
  • 1970-01-01
相关资源
最近更新 更多