简体   繁体   English

无法在 Azure Databricks 中通过 PyPi 安装 python 包

[英]Cannot install python packages thorugh PyPi in Azure Databricks

I want to call a webservice from a Databricks Notebook through Python.我想通过 Python 从 Databricks Notebook 调用 Web 服务。 The needed library for this seems to be http.client.为此所需的库似乎是 http.client。

I have already found a code snippet to test this but when i try to execute it i get the following error:我已经找到了一个代码片段来测试这个,但是当我尝试执行它时,我收到以下错误:

ImportError: No module named http.client导入错误:没有名为 http.client 的模块

This is correct cause i have no module installed yet.这是正确的,因为我还没有安装模块。

In the next step i go to a folder within my Databricks, select Import -> Import Notebooks dialog click on (To import a library, such as a jar or egg, click here) -> Select in the Language DropDown Upload Python Egg or PyPI -> in pyPI name type http.client` and click on Install Library.在下一步中,我转到我的 Databricks 中的文件夹,选择导入 -> 导入笔记本对话框单击(To import a library, such as a jar or egg, click here) -> 在Language下拉Upload Python Egg or PyPI -> in pyPI name type选择Upload Python Egg or PyPI -> in pyPI name type http.client` 并单击安装库。

Then i select Attach automatically to all clusters .然后我选择Attach automatically to all clusters

I receive the following error:我收到以下错误:

Error: java.lang.RuntimeException: Installation failed with message: Collecting http.client Collecting http.client Could not find a version that satisfies the requirement http.client (from versions: ) No matching distribution found for http.client You are using pip version 9.0.1, however version 18.0 is available.错误:java.lang.RuntimeException:安装失败并显示消息:正在收集 http.client 正在收集 http.client 找不到满足 http.client 要求的版本(来自版本:)没有为 http.client 找到匹配的分发您正在使用 pip版本 9.0.1,但是版本 18.0 可用。 You should consider upgrading via the 'pip install --upgrade pip' command.您应该考虑通过“pip install --upgrade pip”命令进行升级。 Could not find a version that satisfies the requirement http.client (from versions: ) No matching distribution found for http.client You are using pip version 9.0.1, however version 18.0 is available.找不到满足 http.client 要求的版本(来自版本:) 找不到与 http.client 匹配的发行版 您使用的是 pip 版本 9.0.1,但是版本 18.0 可用。 You should consider upgrading via the 'pip install --upgrade pip' command.您应该考虑通过“pip install --upgrade pip”命令进行升级。

How can i fix this?我怎样才能解决这个问题?

你能导入httplib吗,它必须解决问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM