alexmojaki / alexmojaki/futurecoder

Detect import errors for auto-installing

Ouverte
#182 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
1.5k
Forks
183
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Some packages have optional dependencies that are only required for some functions. So importing the main package automatically installs it, but using it can still lead to an error. We can detect when this has happened to help users. It requires catching exceptions in `execute`, checking the caught exception as well as the chain of `__cause__` and `__context__` for `ModuleNotFoundError`, and looking at the `name` attribute. Then we tell the user to import the missing module explicitly to 'install' it.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.