Optional and Local Imports

Let's learn about optional and local imports and how it works.

Optional imports

Optional imports are used when we have a preferred module or package that we want to use, but we also want a fallback in case it doesn’t exist. For example, we might use optional imports to support multiple versions of software or for speed ups.

Examples of optional import

Here’s an example from the package github2 that ...

Access this course and 1400+ top-rated courses and projects.