0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[コード] モジュールとPythonバージョンの出力

Last updated at Posted at 2020-12-24

モジュールのバージョン取得

Pythonコード


import sklearn
print('scikit-learn version is {}.'.format(sklearn.__version__))

出力


scikit-learn version is 0.22.

Pythonのバージョン取得

Pythonコード


import platform
import sys

# バージョン番号を示す 5 要素タプル:major, minor, micro, releaselevel, serial
print('python version is {}.'.format(sys.version_info))
# 'major.minor.patchlevel' 形式の文字列
print('python version is {}.'.format(platform.python_version()))
# (※非推奨)Python インタプリタのバージョン番号の他、ビルド番号や使用コンパイラなどの情報を示す文字列
print('python version is {}.'.format(sys.version))

出力


python version is sys.version_info(major=3, minor=6, micro=8, releaselevel='final', serial=0).
python version is 3.6.8.
python version is 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)].
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?