Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
966 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 Reply

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 *

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...