[Code] Module and Python version output

Get module version

Python code


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

output


scikit-learn version is 0.22.

Get Python version

Python code


import platform
import sys

#5-element tuple indicating version number:major, minor, micro, releaselevel, serial
print('python version is {}.'.format(sys.version_info))
# 'major.minor.patchlevel'Format string
print('python version is {}.'.format(platform.python_version()))
# (* Not recommended) A character string that indicates information such as the build number and compiler used in addition to the Python interpreter version number.
print('python version is {}.'.format(sys.version))

output


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)].

Recommended Posts

[Code] Module and Python version output
python input and output
Petit stray Python version output
Python debug and test module
Anaconda and Python version correspondence table
Cooperation between python module and API
Install python and Visual Studio Code on windows10 (April 2020 version)
Python3 socket module and socket communication flow
Export and output files in Python
Installation of Visual studio code and installation of python
python> link> strftime () and strptime () behavior / code
Implementation module "deque" in queue and Python
[python] Difference between rand and randn output
Module import and exception handling in python
Python module import
python learning output
python character code
[Python] Algorithm-aware code
PYTHON2.7 64bit version
Python collections module
Read JSON with Python and output as CSV
Output python log to both console and file
Links and memos of Python character code strings
List of Python code to move and remember
Amazon API Gateway and AWS Lambda Python version
Python version check V outputs standard error output
[Python] Class type and usage of datetime module
Generate and output plantuml object diagram from Python object
Install ZIP version Python and pip on Windows 10
[python] Compress and decompress
"Linear regression" and "Probabilistic version of linear regression" in Python "Bayesian linear regression"
Procedure to load MNIST with python and output to png
python2 series / 3 series, character code and print statement / command line
I tried pipenv and asdf for Python version control
Batch design and python
Python iterators and generators
Python code acceleration approach
Rewrite Python2 code to Python3 (2to3)
python original module import
Let's write python code that parses go code and generates go code
Python packages and modules
Vue-Cli and Python integration
infomap python draw code
Before writing Python code
Receives and outputs standard output of Python 2 and Python 3> C implementations
Ruby, Python and map
__future__ module and future_builtins module
Understanding with mathematical formulas and Python LiNGAM (ICA version)
About Python3 character code
Python and Ruby split
Python audio input / output
Let's use the Python version of the Confluence API module.
Output python execution time
Read json file with Python, format it, and output json
Japanese output in Python
Install pyenv on Raspberry Pi and version control Python
Recursively search for files and directories in Python and output
Python version switching (pyenv)
Python Requests status code
OpenCV basic code (python)
Python3, venv and Ansible