Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
995 views
in Technique[技术] by (71.8m points)

pip - How to install a python wheel file with optional/extra requirements?

Specifically I want to install a wheel file that has extras_require defined.
I can install the package directly with pip install mypackage[myextradependency].

But if I create a wheel file out of it, it does not allow me to do pip install mypackage-1.0-py2.py3-none-any.whl[myextradependency] and gives me a url syntax error. It seems like I am using the wrong syntax, but I was unable to find the correct syntax on the documentation.

I am trying to install the wheel on a databricks job cluster started via Azure data factory. Therefor I do not have access to additional pip commands.

The exact error message is Could not parse URI. Please double check your input.

Thanks for your help

question from:https://stackoverflow.com/questions/65907379/how-to-install-a-python-wheel-file-with-optional-extra-requirements

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I would suggest, that you download the .whl files with the extra dependencies and then install all .whl files you downloaded. Thus you will be able to install the extra dependencies as wheel files.
e.g.:

mkdir whls && cd whls
pip download mypackage[myextradependency]
pip install *

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...