sb-ai-lab / LightAutoML

Fast and customizable framework for automatic ML model creation (AutoML)
https://developers.sber.ru/portal/products/lightautoml
Apache License 2.0
1.09k stars 48 forks source link

Handle import errors of extras modules #60

Open dev-rinchin opened 1 year ago

dev-rinchin commented 1 year ago

🚀 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
github-actions[bot] commented 1 year ago

Stale issue message