Python in Excel では、Pythonコードがクラウド上で実行されます。クラウド上のPythonライブラリのバージョンはいくつなのだろう?とふと思ったので調べてみました。
ライブラリのバージョンを調べる方法とその結果をお知らせします。
サンプルコード
Pythonの入力方法は、以下の記事で詳しく紹介しています。
__version__属性を使ってバージョンを取得
# A1セル
# コアライブラリのバージョンを表示
import matplotlib
s = "コアライブラリ\n"
s += "pandas " + pd.__version__ + "\n"
s += "matplotlib " + matplotlib.__version__ + "\n"
s += "numpy " + np.__version__ + "\n"
s += "seaborn " + sns.__version__ + "\n"
s += "statsmodels " + sm.__version__ + "\n"
# B1セル
# その他のライブラリのバージョンを表示
import astropy
import bs4
import imblearn
import IPython
import gensim
import networkx
import PIL
import tables
import torch
import pywt
import sklearn
import scipy
import nltk
import sympy
import tabulate
s = "その他のライブラリ\n"
s += "astropy " + astropy.__version__ + "\n"
s += "beautifulsoup " + bs4.__version__ + "\n"
s += "imbalanced-learn " + imblearn.__version__ + "\n"
s += "ipython " + IPython.__version__ + "\n"
s += "gensim " + gensim.__version__ + "\n"
s += "networkx " + networkx.__version__ + "\n"
s += "pillow " + PIL.__version__ + "\n"
s += "pytables " + tables.__version__ + "\n"
s += "pytorch " + torch.__version__ + "\n"
s += "pywavelets " + pywt.__version__ + "\n"
s += "scikit-learn " + sklearn.__version__ + "\n"
s += "scipy " + scipy.__version__ + "\n"
s += "snowballstemmer " + nltk.__version__ + "\n"
s += "sympy " + sympy.__version__ + "\n"
s += "tabulate " + tabulate.__version__ + "\n"
結果
参考
PEP 396 – Module Version Numbers | peps.python.org
Given that it is useful and common to specify version numbers for Python modules, and given that different ways of doing this have grown organically within the ...
Pythonのパッケージ(ライブラリ)のバージョンを確認 | note.nkmk.me
Pythonのスクリプトで使用されているパッケージ(ライブラリ)やモジュールのバージョン、および、環境にインストールされているパッケージのバージョンを確認する方法を説明する。 スクリプトで確認・表示: __versi ...