質問編集履歴

5

ミス訂正

2018/02/25 08:18

投稿

Hayato1201
Hayato1201

スコア220

test CHANGED
File without changes
test CHANGED
@@ -108,11 +108,11 @@
108
108
 
109
109
  今度はiex> Pyex.predict()で以下のようなエラーが出てしまいました。
110
110
 
111
- ** (ErlangError) Erlang error: {:python, :"exceptions.ImportError", 'No module named keras.models', [{"/Users/tmsmac/pyex/lib/predict_sin.py", 2, "<module>", :undefined}, {"/Users/tmsmac/pyex/_build/dev/lib/erlport/priv/python2/erlport/erlang.py", 226, "_incoming_call", "f = __import__(module, {}, {}, [objects[0]])"}, {"/Users/tmsmac/pyex/_build/dev/lib/erlport/priv/python2/erlport/erlang.py", 234, "_call_with_error_handler", "function(*args)"}]}
111
+ ** (ErlangError) Erlang error: {:python, :"exceptions.ImportError", 'No module named keras.models', [{"/Users/tmsmac/pyex/lib/py_predict_sin.py", 2, "<module>", "from keras.models import Sequential"}, {"/Users/tmsmac/pyex/_build/dev/lib/erlport/priv/python2/erlport/erlang.py", 226, "_incoming_call", "f = __import__(module, {}, {}, [objects[0]])"}, {"/Users/tmsmac/pyex/_build/dev/lib/erlport/priv/python2/erlport/erlang.py", 234, "_call_with_error_handler", "function(*args)"}]}
112
112
 
113
113
  (erlport) /Users/tmsmac/pyex/deps/erlport/src/erlport.erl:234: :erlport.call/3
114
114
 
115
- (pyex) lib/pyex.ex:11: Pyex.predict/0
115
+ (pyex) lib/pyex.ex:27: Pyex.predict/0
116
116
 
117
117
 
118
118
 

4

追記

2018/02/25 08:18

投稿

Hayato1201
Hayato1201

スコア220

test CHANGED
File without changes
test CHANGED
@@ -97,3 +97,23 @@
97
97
 
98
98
 
99
99
  (erlport) :python.stop()
100
+
101
+
102
+
103
+ ーーーーーーーーーーーーーーーーーーーーーーーーーーー
104
+
105
+ 追記です
106
+
107
+
108
+
109
+ 今度はiex> Pyex.predict()で以下のようなエラーが出てしまいました。
110
+
111
+ ** (ErlangError) Erlang error: {:python, :"exceptions.ImportError", 'No module named keras.models', [{"/Users/tmsmac/pyex/lib/predict_sin.py", 2, "<module>", :undefined}, {"/Users/tmsmac/pyex/_build/dev/lib/erlport/priv/python2/erlport/erlang.py", 226, "_incoming_call", "f = __import__(module, {}, {}, [objects[0]])"}, {"/Users/tmsmac/pyex/_build/dev/lib/erlport/priv/python2/erlport/erlang.py", 234, "_call_with_error_handler", "function(*args)"}]}
112
+
113
+ (erlport) /Users/tmsmac/pyex/deps/erlport/src/erlport.erl:234: :erlport.call/3
114
+
115
+ (pyex) lib/pyex.ex:11: Pyex.predict/0
116
+
117
+
118
+
119
+ keras単品では動いています。また、pyex.exのコンパイルも通っています。これも上記で修正していただいたようにファイルにpy_をつけたりstopの部分を変えたりしましたがそれでもダメだったので何か他の原因でしょうか?

3

修正

2018/02/25 08:02

投稿

Hayato1201
Hayato1201

スコア220

test CHANGED
File without changes
test CHANGED
@@ -84,16 +84,16 @@
84
84
 
85
85
 
86
86
 
87
+ I'm Python...receive 3
88
+
89
+ received from python: 30
90
+
87
- Erlang/OTP 20 [erts-9.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
91
+ ** (UndefinedFunctionError) function :python.stop/0 is undefined or private. Did you mean one of:
88
92
 
89
93
 
90
94
 
91
- Interactive Elixir (1.6.1) - press Ctrl+C to exit (type h() ENTER for help)
95
+ * stop/1
92
96
 
93
- iex(1)> Pyex.value_receive( 3 )
94
97
 
95
- ** (ErlangError) Erlang error: {:python, :"exceptions.ImportError", 'No module named py_sample', [{"/Users/tmsmac/pyex/_build/dev/lib/erlport/priv/python2/erlport/erlang.py", 226, "_incoming_call", "f = __import__(module, {}, {}, [objects[0]])"}, {"/Users/tmsmac/pyex/_build/dev/lib/erlport/priv/python2/erlport/erlang.py", 234, "_call_with_error_handler", "function(*args)"}]}
96
98
 
97
- (erlport) /Users/tmsmac/pyex/deps/erlport/src/erlport.erl:234: :erlport.call/3
98
-
99
- (pyex) lib/pyex.ex:4: Pyex.value_receive/1
99
+ (erlport) :python.stop()

2

追記

2018/02/25 05:07

投稿

Hayato1201
Hayato1201

スコア220

test CHANGED
File without changes
test CHANGED
@@ -67,3 +67,33 @@
67
67
  ===> When submitting a bug report, please include the output of `rebar3 report "your command"`
68
68
 
69
69
  ** (Mix) Could not compile dependency :erlport, "/Users/tmsmac/.mix/rebar3 bare compile --paths "/Users/tmsmac/Google ドライブ/Elixir/pyex/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile erlport", update it with "mix deps.update erlport" or clean it with "mix deps.clean erlport"
70
+
71
+
72
+
73
+ ------------------------------------------------
74
+
75
+ さらに追記です
76
+
77
+
78
+
79
+ 早速の返信ありがとうございます!!
80
+
81
+ 確かにGoogleドライブから出たところに作り直したらこのエラーがなくなりました。。。ディレクトリの名前なんかでエラーが出ることがあるんですね、、、これは日本語のディレクトリ内からは実行できないものなんでしょうか?結構不便ですね。
82
+
83
+  また、さらにそこで実行したところ関数名を入力するところまで行ったのですが、ここで今度は以下の様なエラーが出ました。今度はどうすればいいのでしょうか??
84
+
85
+
86
+
87
+ Erlang/OTP 20 [erts-9.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
88
+
89
+
90
+
91
+ Interactive Elixir (1.6.1) - press Ctrl+C to exit (type h() ENTER for help)
92
+
93
+ iex(1)> Pyex.value_receive( 3 )
94
+
95
+ ** (ErlangError) Erlang error: {:python, :"exceptions.ImportError", 'No module named py_sample', [{"/Users/tmsmac/pyex/_build/dev/lib/erlport/priv/python2/erlport/erlang.py", 226, "_incoming_call", "f = __import__(module, {}, {}, [objects[0]])"}, {"/Users/tmsmac/pyex/_build/dev/lib/erlport/priv/python2/erlport/erlang.py", 234, "_call_with_error_handler", "function(*args)"}]}
96
+
97
+ (erlport) /Users/tmsmac/pyex/deps/erlport/src/erlport.erl:234: :erlport.call/3
98
+
99
+ (pyex) lib/pyex.ex:4: Pyex.value_receive/1

1

追記

2018/02/25 05:03

投稿

Hayato1201
Hayato1201

スコア220

test CHANGED
File without changes
test CHANGED
@@ -41,3 +41,29 @@
41
41
 
42
42
 
43
43
  この様なエラーが出ます。これはどういうことでしょうか?
44
+
45
+
46
+
47
+ _____________________________
48
+
49
+
50
+
51
+ 追記です
52
+
53
+
54
+
55
+ 回答ありがとうございます!!
56
+
57
+
58
+
59
+ 確かにディレクトリの位置を間違えてはいた様です。pyex.exを作ったディレクトリではなくその上のlibやmix.exsがあるディレクトリで実行するべきだったという事ですね?そこで今回そこのディレクトリで行ったのですが、次の様なエラーが出ました・・・これはどういう事でしょうか?
60
+
61
+ Erlang/OTP 20 [erts-9.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
62
+
63
+
64
+
65
+ ===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
66
+
67
+ ===> When submitting a bug report, please include the output of `rebar3 report "your command"`
68
+
69
+ ** (Mix) Could not compile dependency :erlport, "/Users/tmsmac/.mix/rebar3 bare compile --paths "/Users/tmsmac/Google ドライブ/Elixir/pyex/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile erlport", update it with "mix deps.update erlport" or clean it with "mix deps.clean erlport"