最后活跃于 10 months ago

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

timmy 修订了这个 Gist 10 months ago. 转到此修订

没有任何变更

timmy 修订了这个 Gist 10 months ago. 转到此修订

1 file changed, 6 insertions

check_numpy_installed.py(文件已创建)

@@ -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")
上一页 下一页