質問するログイン新規登録

質問編集履歴

8

Markdownを変更。

2018/03/19 00:23

投稿

miyakazu
miyakazu

スコア7

title CHANGED
File without changes
body CHANGED
@@ -57,7 +57,7 @@
57
57
  block_cipher = None
58
58
 
59
59
  himports = [
60
- 'pandas', 'sklearn']**
60
+ 'pandas', 'sklearn']
61
61
 
62
62
  def get_pandas_path():
63
63
  import pandas

7

Markdownを変更。

2018/03/19 00:23

投稿

miyakazu
miyakazu

スコア7

title CHANGED
File without changes
body CHANGED
@@ -56,18 +56,18 @@
56
56
 
57
57
  block_cipher = None
58
58
 
59
- **himports = [
59
+ himports = [
60
60
  'pandas', 'sklearn']**
61
61
 
62
- **def get_pandas_path():
62
+ def get_pandas_path():
63
63
  import pandas
64
64
  pandas_path = pandas.__path__[0]
65
- return pandas_path**
65
+ return pandas_path
66
66
 
67
- **def get_sklearn_path():
67
+ def get_sklearn_path():
68
68
  import sklearn
69
69
  sklearn_path = sklearn.__path__[0]
70
- return sklearn_path**
70
+ return sklearn_path
71
71
 
72
72
  a = Analysis(['SimplePred01.py'],
73
73
  pathex=['C:\Users\z05464p0\Python\F_test02\make_exe'],
@@ -81,14 +81,14 @@
81
81
  win_private_assemblies=False,
82
82
  cipher=block_cipher)
83
83
 
84
- **dict_tree = Tree(get_pandas_path(), prefix='pandas', excludes=["*.pyc"])
84
+ dict_tree = Tree(get_pandas_path(), prefix='pandas', excludes=["*.pyc"])
85
85
  a.datas += dict_tree
86
- a.binaries = filter(lambda x: 'pandas' not in x[0], a.binaries)**
86
+ a.binaries = filter(lambda x: 'pandas' not in x[0], a.binaries)
87
87
 
88
- **
88
+
89
89
  dict_tree = Tree(get_sklearn_path(), prefix='sklearn', excludes=["*.pyc"])
90
90
  a.datas += dict_tree
91
- a.binaries = filter(lambda x: 'sklearn' not in x[0], a.binaries)**
91
+ a.binaries = filter(lambda x: 'sklearn' not in x[0], a.binaries)
92
92
 
93
93
  pyz = PYZ(a.pure, a.zipped_data,
94
94
  cipher=block_cipher)

6

Markdown法を使用。

2018/03/19 00:21

投稿

miyakazu
miyakazu

スコア7

title CHANGED
File without changes
body CHANGED
@@ -1,9 +1,8 @@
1
1
  ### 前提・実現したいこと
2
-
3
2
  Python3.6のsklearnを使用して簡単な重回帰分析を行うプログラムをexeで動かしたい。
4
3
 
5
4
  ### 発生している問題・エラーメッセージ
6
- '''
5
+ ```Python
7
6
  Traceback (most recent call last):
8
7
  File "SimplePred01.py", line 3, in <module>
9
8
  import sklearn
@@ -47,31 +46,28 @@
47
46
  module = loader.load_module(fullname)
48
47
  ImportError: DLL load failed: 指定されたモジュールが見つかりません。
49
48
  [11720] Failed to execute script SimplePred01
50
- '''
49
+ ```
51
50
 
52
51
  ### 該当のソースコード
53
52
  Pyinstallerでexe化するときに使用したspecファイルの中身。
54
53
  他ブログ等を参考にして、pandasは読み込んだが、sklearnを読み込んでいないっぽい。
55
- '''
54
+ ```Python
56
55
  # -*- mode: python -*-
57
56
 
58
57
  block_cipher = None
59
58
 
60
- #試したこと2↓
61
- himports = [
59
+ **himports = [
62
- 'pandas', 'sklearn']
60
+ 'pandas', 'sklearn']**
63
61
 
64
- #試したこと3↓
65
- def get_pandas_path():
62
+ **def get_pandas_path():
66
63
  import pandas
67
64
  pandas_path = pandas.__path__[0]
68
- return pandas_path
65
+ return pandas_path**
69
66
 
70
- 試したこと4↓
71
- def get_sklearn_path():
67
+ **def get_sklearn_path():
72
68
  import sklearn
73
69
  sklearn_path = sklearn.__path__[0]
74
- return sklearn_path
70
+ return sklearn_path**
75
71
 
76
72
  a = Analysis(['SimplePred01.py'],
77
73
  pathex=['C:\Users\z05464p0\Python\F_test02\make_exe'],
@@ -85,15 +81,14 @@
85
81
  win_private_assemblies=False,
86
82
  cipher=block_cipher)
87
83
 
88
- #試したこと3↓
89
- dict_tree = Tree(get_pandas_path(), prefix='pandas', excludes=["*.pyc"])
84
+ **dict_tree = Tree(get_pandas_path(), prefix='pandas', excludes=["*.pyc"])
90
85
  a.datas += dict_tree
91
- a.binaries = filter(lambda x: 'pandas' not in x[0], a.binaries)
86
+ a.binaries = filter(lambda x: 'pandas' not in x[0], a.binaries)**
92
87
 
93
- 試したこと4↓
88
+ **
94
89
  dict_tree = Tree(get_sklearn_path(), prefix='sklearn', excludes=["*.pyc"])
95
90
  a.datas += dict_tree
96
- a.binaries = filter(lambda x: 'sklearn' not in x[0], a.binaries)
91
+ a.binaries = filter(lambda x: 'sklearn' not in x[0], a.binaries)**
97
92
 
98
93
  pyz = PYZ(a.pure, a.zipped_data,
99
94
  cipher=block_cipher)
@@ -112,11 +107,11 @@
112
107
  strip=False,
113
108
  upx=True,
114
109
  name='SimplePred01')
115
- '''
110
+ ```
116
111
  ### 試したこと
117
112
  1. venv仮想環境で最低限のモジュールでexe化。
118
- 2. .specにhimports = ['pandas', 'sklearn']を追加。
113
+ 2. .specに`himports = ['pandas', 'sklearn']`を追加。
119
- 3. .specにget_pandas_path()などを追加。pandasは読み込まれるようになった。
114
+ 3. .specに`get_pandas_path()`などを追加。pandasは読み込まれるようになった。
120
- 4. .specにget_sklearn_path()などを追加。sklearnは読み込まなかった。
115
+ 4. .specに`get_sklearn_path()`などを追加。sklearnは読み込まなかった。
121
116
 
122
117
  ### 補足情報(FW/ツールのバージョンなど)

5

試したことの詳細を記述。

2018/03/19 00:15

投稿

miyakazu
miyakazu

スコア7

title CHANGED
File without changes
body CHANGED
@@ -57,14 +57,17 @@
57
57
 
58
58
  block_cipher = None
59
59
 
60
+ #試したこと2↓
60
61
  himports = [
61
62
  'pandas', 'sklearn']
62
63
 
64
+ #試したこと3↓
63
65
  def get_pandas_path():
64
66
  import pandas
65
67
  pandas_path = pandas.__path__[0]
66
68
  return pandas_path
67
69
 
70
+ 試したこと4↓
68
71
  def get_sklearn_path():
69
72
  import sklearn
70
73
  sklearn_path = sklearn.__path__[0]
@@ -82,10 +85,12 @@
82
85
  win_private_assemblies=False,
83
86
  cipher=block_cipher)
84
87
 
88
+ #試したこと3↓
85
89
  dict_tree = Tree(get_pandas_path(), prefix='pandas', excludes=["*.pyc"])
86
90
  a.datas += dict_tree
87
91
  a.binaries = filter(lambda x: 'pandas' not in x[0], a.binaries)
88
92
 
93
+ 試したこと4↓
89
94
  dict_tree = Tree(get_sklearn_path(), prefix='sklearn', excludes=["*.pyc"])
90
95
  a.datas += dict_tree
91
96
  a.binaries = filter(lambda x: 'sklearn' not in x[0], a.binaries)
@@ -109,8 +114,9 @@
109
114
  name='SimplePred01')
110
115
  '''
111
116
  ### 試したこと
117
+ 1. venv仮想環境で最低限のモジュールでexe化。
118
+ 2. .specにhimports = ['pandas', 'sklearn']を追加。
119
+ 3. .specにget_pandas_path()などを追加。pandasは読み込まれるようになった。
120
+ 4. .specにget_sklearn_path()などを追加。sklearnは読み込まなかった。
112
121
 
113
- venv仮想環境で最低限のモジュールでexe化
114
- .specを他記事を参考していじってpandasは読み込んだが、sklearnは読み込めない。
115
-
116
122
  ### 補足情報(FW/ツールのバージョンなど)

4

"""でソースとエラーを囲む

2018/03/19 00:11

投稿

miyakazu
miyakazu

スコア7

title CHANGED
File without changes
body CHANGED
@@ -3,7 +3,7 @@
3
3
  Python3.6のsklearnを使用して簡単な重回帰分析を行うプログラムをexeで動かしたい。
4
4
 
5
5
  ### 発生している問題・エラーメッセージ
6
- """
6
+ '''
7
7
  Traceback (most recent call last):
8
8
  File "SimplePred01.py", line 3, in <module>
9
9
  import sklearn
@@ -47,12 +47,12 @@
47
47
  module = loader.load_module(fullname)
48
48
  ImportError: DLL load failed: 指定されたモジュールが見つかりません。
49
49
  [11720] Failed to execute script SimplePred01
50
- """
50
+ '''
51
51
 
52
52
  ### 該当のソースコード
53
53
  Pyinstallerでexe化するときに使用したspecファイルの中身。
54
54
  他ブログ等を参考にして、pandasは読み込んだが、sklearnを読み込んでいないっぽい。
55
- """
55
+ '''
56
56
  # -*- mode: python -*-
57
57
 
58
58
  block_cipher = None
@@ -107,7 +107,7 @@
107
107
  strip=False,
108
108
  upx=True,
109
109
  name='SimplePred01')
110
- """
110
+ '''
111
111
  ### 試したこと
112
112
 
113
113
  venv仮想環境で最低限のモジュールでexe化

3

"""でソースとエラーを囲む

2018/03/18 23:46

投稿

miyakazu
miyakazu

スコア7

title CHANGED
File without changes
body CHANGED
@@ -3,6 +3,7 @@
3
3
  Python3.6のsklearnを使用して簡単な重回帰分析を行うプログラムをexeで動かしたい。
4
4
 
5
5
  ### 発生している問題・エラーメッセージ
6
+ """
6
7
  Traceback (most recent call last):
7
8
  File "SimplePred01.py", line 3, in <module>
8
9
  import sklearn
@@ -46,11 +47,12 @@
46
47
  module = loader.load_module(fullname)
47
48
  ImportError: DLL load failed: 指定されたモジュールが見つかりません。
48
49
  [11720] Failed to execute script SimplePred01
50
+ """
49
51
 
50
52
  ### 該当のソースコード
51
53
  Pyinstallerでexe化するときに使用したspecファイルの中身。
52
54
  他ブログ等を参考にして、pandasは読み込んだが、sklearnを読み込んでいないっぽい。
53
-
55
+ """
54
56
  # -*- mode: python -*-
55
57
 
56
58
  block_cipher = None
@@ -105,7 +107,7 @@
105
107
  strip=False,
106
108
  upx=True,
107
109
  name='SimplePred01')
108
-
110
+ """
109
111
  ### 試したこと
110
112
 
111
113
  venv仮想環境で最低限のモジュールでexe化

2

コードとエラーを追加。

2018/03/18 23:44

投稿

miyakazu
miyakazu

スコア7

title CHANGED
File without changes
body CHANGED
@@ -3,13 +3,109 @@
3
3
  Python3.6のsklearnを使用して簡単な重回帰分析を行うプログラムをexeで動かしたい。
4
4
 
5
5
  ### 発生している問題・エラーメッセージ
6
+ Traceback (most recent call last):
7
+ File "SimplePred01.py", line 3, in <module>
8
+ import sklearn
9
+ File "c:\venv\ins\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
10
+ line 631, in exec_module
11
+ exec(bytecode, module.__dict__)
12
+ File "lib\site-packages\sklearn\__init__.py", line 134, in <module>
13
+ File "c:\venv\ins\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
14
+ line 631, in exec_module
15
+ exec(bytecode, module.__dict__)
16
+ File "lib\site-packages\sklearn\base.py", line 13, in <module>
17
+ File "c:\venv\ins\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
18
+ line 631, in exec_module
19
+ exec(bytecode, module.__dict__)
20
+ File "lib\site-packages\sklearn\utils\__init__.py", line 11, in <module>
21
+ File "c:\venv\ins\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
22
+ line 631, in exec_module
23
+ exec(bytecode, module.__dict__)
24
+ File "lib\site-packages\sklearn\utils\validation.py", line 18, in <module>
25
+ File "c:\venv\ins\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
26
+ line 631, in exec_module
27
+ exec(bytecode, module.__dict__)
28
+ File "lib\site-packages\sklearn\utils\fixes.py", line 144, in <module>
29
+ File "c:\venv\ins\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
30
+ line 631, in exec_module
31
+ exec(bytecode, module.__dict__)
32
+ File "lib\site-packages\scipy\sparse\linalg\__init__.py", line 114, in <module
33
+ >
34
+ File "c:\venv\ins\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
35
+ line 631, in exec_module
36
+ exec(bytecode, module.__dict__)
37
+ File "lib\site-packages\scipy\sparse\linalg\isolve\__init__.py", line 6, in <m
38
+ odule>
39
+ File "c:\venv\ins\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
40
+ line 631, in exec_module
41
+ exec(bytecode, module.__dict__)
42
+ File "lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 7, in <
43
+ module>
44
+ File "c:\venv\ins\lib\site-packages\PyInstaller\loader\pyimod03_importers.py",
45
+ line 714, in load_module
46
+ module = loader.load_module(fullname)
47
+ ImportError: DLL load failed: 指定されたモジュールが見つかりません。
48
+ [11720] Failed to execute script SimplePred01
6
49
 
7
- Pyinstallerでexe化は出来たが、Pandasとsklearnのモジュールが読み込めていない。
8
-
9
50
  ### 該当のソースコード
51
+ Pyinstallerでexe化するときに使用したspecファイルの中身。
52
+ 他ブログ等を参考にして、pandasは読み込んだが、sklearnを読み込んでいないっぽい。
10
53
 
54
+ # -*- mode: python -*-
11
55
 
56
+ block_cipher = None
12
57
 
58
+ himports = [
59
+ 'pandas', 'sklearn']
60
+
61
+ def get_pandas_path():
62
+ import pandas
63
+ pandas_path = pandas.__path__[0]
64
+ return pandas_path
65
+
66
+ def get_sklearn_path():
67
+ import sklearn
68
+ sklearn_path = sklearn.__path__[0]
69
+ return sklearn_path
70
+
71
+ a = Analysis(['SimplePred01.py'],
72
+ pathex=['C:\Users\z05464p0\Python\F_test02\make_exe'],
73
+ binaries=[],
74
+ datas=[],
75
+ hiddenimports=[],
76
+ hookspath=[],
77
+ runtime_hooks=[],
78
+ excludes=[],
79
+ win_no_prefer_redirects=False,
80
+ win_private_assemblies=False,
81
+ cipher=block_cipher)
82
+
83
+ dict_tree = Tree(get_pandas_path(), prefix='pandas', excludes=["*.pyc"])
84
+ a.datas += dict_tree
85
+ a.binaries = filter(lambda x: 'pandas' not in x[0], a.binaries)
86
+
87
+ dict_tree = Tree(get_sklearn_path(), prefix='sklearn', excludes=["*.pyc"])
88
+ a.datas += dict_tree
89
+ a.binaries = filter(lambda x: 'sklearn' not in x[0], a.binaries)
90
+
91
+ pyz = PYZ(a.pure, a.zipped_data,
92
+ cipher=block_cipher)
93
+ exe = EXE(pyz,
94
+ a.scripts,
95
+ exclude_binaries=True,
96
+ name='SimplePred01',
97
+ debug=False,
98
+ strip=False,
99
+ upx=True,
100
+ console=True )
101
+ coll = COLLECT(exe,
102
+ a.binaries,
103
+ a.zipfiles,
104
+ a.datas,
105
+ strip=False,
106
+ upx=True,
107
+ name='SimplePred01')
108
+
13
109
  ### 試したこと
14
110
 
15
111
  venv仮想環境で最低限のモジュールでexe化

1

誤字修正

2018/03/16 06:03

投稿

miyakazu
miyakazu

スコア7

title CHANGED
File without changes
body CHANGED
@@ -1,6 +1,6 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
- Python3.6のsklearnを使用しようして簡単な重回帰分析を行うプログラムをexeで動かしたい。
3
+ Python3.6のsklearnを使用して簡単な重回帰分析を行うプログラムをexeで動かしたい。
4
4
 
5
5
  ### 発生している問題・エラーメッセージ
6
6