LightAutoML icon indicating copy to clipboard operation
LightAutoML copied to clipboard

Handle import errors of extras modules

Open dev-rinchin opened this issue 2 years ago • 1 comments

🚀 Feature Request

LightAutoML should inform a user about additional extras that he needs to install to avoid the import problem. Similar to: https://github.com/sb-ai-lab/LightAutoML/blob/f2fa4107b5256e65ace778561ac62037f48d3190/lightautoml/report/report_deco.py#L1134

https://github.com/sb-ai-lab/LightAutoML/blob/f2fa4107b5256e65ace778561ac62037f48d3190/lightautoml/text/tokenizer.py#L21

Or automatically install missing extras as in following proposal.

Proposal

try:
    from weasyprint import HTML
except ImportError:
    import pip
    pip.main(['install', '--user', 'lightautoml[pdf]'])
    from weasyprint import HTML

dev-rinchin avatar Jan 24 '23 08:01 dev-rinchin

Stale issue message

github-actions[bot] avatar Apr 01 '23 02:04 github-actions[bot]