Please catch the Error as early as possible:
```python
try:
    module = import_module(...)
except ImportError:
    ...
else:
   moduls.append(...)
```