Search code examples
pythonazurepippypidatabricks

Cannot install python packages thorugh PyPi in Azure Databricks


I want to call a webservice from a Databricks Notebook through Python. The needed library for this seems to be 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

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 typehttp.client` and click on Install Library.

Then i select 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. You should consider upgrading via the 'pip install --upgrade pip' command. 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. You should consider upgrading via the 'pip install --upgrade pip' command.

How can i fix this?


Solution

  • Can you import httplib, it must resolve the issue