使うというかpyxファイルをビルドする時点でエラーを吐いてしまいました
以下に実行ファイルと実行結果を記します
expがおかしいようなのですが、どう改善していいかわかりません
ちなみに、1つのsetup.pyで複数のモジュールをビルドするには
どうすればよいでしょうか
よろしくお願いします
python
1alpha.pyx 2 3def alpha_z(to_all, to_user,t_user,t_all): 4 a = exp(t_all + t_user) / (sum([exp(tall + tuser) for tall, tuser in zip(to_all, to_user)])) 5 return a 6 7---------------------------------------------------------- 8setup.py 9 10# -*- coding: utf-8 -*- 11 12from distutils.core import setup 13from distutils.extension import Extension 14from Cython.Distutils import build_ext 15 16# for notes on compiler flags e.g. using 17# export CFLAGS=-O2 18# so gcc has -O2 passed (even though it doesn't make the code faster!) 19# http://docs.python.org/install/index.html 20 21ext_modules = [ 22 Extension( "alpha", ["alpha.pyx"] ), 23] 24 25setup( 26 name = " alpha app" , 27 cmdclass={'build_ext': build_ext }, 28 ext_modules = ext_modules, 29) 30 31------------------------------------------------------------------- 32実行結果 33 34running build_ext 35cythoning alpha.pyx to alpha.c 36 37Error compiling Cython file: 38------------------------------------------------------------ 39... 40# -*- coding: utf-8 -*- 41 42def alpha_z(to_all, to_user,t_user,t_all): 43 """alpha a list using em_ST update rule""" 44 a = exp(t_all + t_user) / (sum([exp(tall + tuser) for tall, tuser in zip(to_all, to_user)])) 45 ^ 46------------------------------------------------------------ 47 48alpha.pyx:5:11: undeclared name not builtin: exp 49building 'alpha' extension 50C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:\Users\AppData\Local\conda\conda\envs\anaconda\include" "-IC:\Users\AppData\Local\conda\conda\envs\anaconda\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tcalpha.c /Fobuild\temp.win-amd64-3.6\Release\alpha.obj 51alpha.c 52alpha.c(1): fatal error C1189: #error: Do not use this file, it is the result of a failed Cython compilation. 53error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/07/12 13:14