check_numpy_installed.py
· 147 B · Python
Brut
from importlib.util import find_spec
if find_spec("numpy") is not None:
print("numpy is installed")
else:
print("numpy is not installed")
| 1 | from importlib.util import find_spec |
| 2 | |
| 3 | if find_spec("numpy") is not None: |
| 4 | print("numpy is installed") |
| 5 | else: |
| 6 | print("numpy is not installed") |
| 7 |