Last active 10 months ago

這段程式碼用於檢查 Python 環境中是否安裝了 numpy 模組。 如果 numpy 已安裝,則輸出 "numpy is installed",否則輸出 "numpy is not installed"。

timmy revised this gist 10 months ago. Go to revision

No changes

timmy revised this gist 10 months ago. Go to revision

1 file changed, 6 insertions

check_numpy_installed.py(file created)

@@ -0,0 +1,6 @@
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")
Newer Older