在jupyter notebook擷取目前環境的所有庫的清單
有時我想知道目前jupyter notebook使用的庫清單,還想知道目前jupyter notebook 使用的環境是哪個。
代碼
from pip._internal.utils.misc import get_installed_distributions
for dist in get_installed_distributions():
print(dist)
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicmbw5iNjdjN2UDN3YWOiFTO3UDOxEzNjVmMhhTNhdzN0UWO08CX0JXZ252bj91Ztl2Lc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
from pip._internal.utils.misc import get_installed_distributions
a = get_installed_distributions()
print(a)