cx_freeze
개발 버전을 사용 중입니다 (here으로 알려짐). 최신 안정 버전 1.3.1을 사용해 보았습니다. numpy 및 Enthought Canopy 배포 파일을 가져 오는 파일에서 Windows 용 실행 파일을 작성하려고합니다.cx_freeze가 numpy 실행 파일을 생성하지 못했습니다.
Traceback (most recent call last):
File "C:\Users\Zah\AppData\Local\Enthought\Canopy32\User\lib\site-packages\cx_
freeze-4.3.1-py2.7-win32.egg\cx_Freeze\initscripts\Console.py", line 27, in <mod
ule>
exec code in m.__dict__
File "test.py", line 7, in <module>
File "C:\Users\Zah\AppData\Local\Enthought\Canopy32\User\lib\site-packages\num
py\__init__.py", line 143, in <module>
import add_newdocs
File "C:\Users\Zah\AppData\Local\Enthought\Canopy32\User\lib\site-packages\num
py\add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "C:\Users\Zah\AppData\Local\Enthought\Canopy32\User\lib\site-packages\num
py\lib\__init__.py", line 13, in <module>
from polynomial import *
File "C:\Users\Zah\AppData\Local\Enthought\Canopy32\User\lib\site-packages\num
py\lib\polynomial.py", line 17, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "C:\Users\Zah\AppData\Local\Enthought\Canopy32\User\lib\site-packages\num
py\linalg\__init__.py", line 48, in <module>
from linalg import *
File "C:\Users\Zah\AppData\Local\Enthought\Canopy32\User\lib\site-packages\num
py\linalg\linalg.py", line 23, in <module>
from numpy.linalg import lapack_lite
File "ExtensionLoader_numpy_linalg_lapack_lite.py", line 22, in <module>
File "ExtensionLoader_numpy_linalg_lapack_lite.py", line 14, in __bootstrap__
ImportError: DLL load failed: No se puede encontrar el m¾dulo especificado.
I가주의 사항 :
import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]}
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
base = None
setup( name = "foo",
version = "0.1",
description = "My GUI application!",
options = {"build_exe": build_exe_options},
executables = [Executable("test.py", base=base)])
이 EXE 파일을 실행할 때 내가 오류는 다음과 같습니다
import numpy as np
def f(x):
y = np.linspace(0,x,1000)
return y
if __name__ == '__main__':
print f(5)
이는 setup.py 파일입니다 :이 파일 test.py
입니다 빌드 디렉토리에 numpy.linalg.lapack_lite.pyd
파일이 있습니다.
답변을 찾았습니까? 많이 도움이 될 수 있습니다. –
PyInstaller를 사용하여 종료되었습니다. 고통도 있었지만 결국 효과가있었습니다. – Zah
예, 나는 pyinstaller로도 알아낼 수 있습니다. thanks –