alexmojaki / alexmojaki/futurecoder

Detect import errors for auto-installing

Open
#182 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.5k
Forks
183
PR merge metrics
No merged PRs in 30d

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.