错误:[错误2]没有这样的文件或目录:'C:\ Python27 \ lib \ site-packages \ clr \ Python.Runtime.dll
setup.py的代码
import sys
from cx_Freeze import setup, Executable
setup( name = "Severity_Insertion.py",
version = "2.7",
description = "Executable of serirty",
executables = [Executable("Severity_Insertion.py",base = "Win32GUI")]
)
与我的错误相关的hooks.py代码
def load_clr(finder, module):
"""the pythonnet package (imported as 'clr') needs Python.Runtime.dll
in runtime"""
module_dir = os.path.dirname(module.file)
dllname = 'Python.Runtime.dll'
finder.IncludeFiles(os.path.join(module_dir, dllname), dllname)
def load_sqlite3(finder, module):
"""In Windows, the sqlite3 module requires an additional dll sqlite3.dll to
be present in the build directory."""
if sys.platform == "win32":
dll_name = "sqlite3.dll"
dll_path = os.path.join(_get_base_prefix(), "DLLs", dll_name)
finder.IncludeFiles(dll_path, os.path.join("lib", dll_name))
答案 0 :(得分:0)
此行:
finder.IncludeFiles(os.path.join(module_dir, dllname), dllname)
应为:
finder.IncludeFiles(dllname, dllname)
因为pythonnet
个文件Python.Runtime.dll
和clr.pyd
位于site-packages
的正下方。