-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenvchecker.py
More file actions
91 lines (76 loc) · 2.01 KB
/
Copy pathenvchecker.py
File metadata and controls
91 lines (76 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
def check():
"""
実行環境をチェック
"""
import socket
import platform
import datetime
# コンピュータ名を取得
print('hostname:{}'.format(socket.gethostname()))
# pythonや各ライブラリのバージョンを確認
print('python:{}'.format(platform.python_version()))
# 実行日時を取得
print('current time:{}'.format(datetime.datetime.now()))
print('library version:')
libdict = {}
# numpy
try:
import numpy as np
libdict['numpy'] = np.__version__
except ModuleNotFoundError:
pass
# pandas
try:
import pandas as pd
libdict['pandas'] = pd.__version__
except ModuleNotFoundError:
pass
# matplotlib
try:
import matplotlib
libdict['matplotlib'] = matplotlib.__version__
except ModuleNotFoundError:
pass
# seaborn
try:
import seaborn as sns
libdict['seaborn'] = sns.__version__
except ModuleNotFoundError:
pass
# scipy
try:
import scipy
libdict['scipy'] = scipy.__version__
except ModuleNotFoundError:
pass
# sklearn
try:
import sklearn
libdict['sklearn'] = sklearn.__version__
except ModuleNotFoundError:
pass
# pytorch
try:
import torch
libdict['torch'] = torch.__version__
libdict['torch-cuda'] = torch.cuda_version
libdict['torch-cuda is available'] = torch.cuda.is_available()
except ModuleNotFoundError:
pass
except OSError:
pass
# plotly
try:
import plotly
libdict['plotly'] = plotly.__version__
except ModuleNotFoundError:
pass
# rdkit
try:
import rdkit
libdict['rdkit'] = rdkit.__version__
except ModuleNotFoundError:
pass
for name, value in libdict.items():
print('\t{}:{}'.format(name, value))
#