简体   繁体   English

Py2exe附魔错误

[英]Py2exe enchant error

Hi i compiled my python script that includes enchant and when i try to execute my program i get the following error 嗨,我编译了包含附魔的python脚本,当我尝试执行程序时,出现以下错误

ImportError: The 'enchant' C library was not found. Please install it via your OS package manager, or use a pre-built binary wheel from PyPI.

I run 64bit Windows. 我运行64位Windows。 My setup.py file looks like this 我的setup.py文件看起来像这样

   from distutils.core import setup
from glob import glob
from PyQt4 import QtCore, QtGui
import numpy as np
import sys
import os, os.path
import time
import exifread
import logging
import re
import datetime
import hashlib
import sqlite3
import MySQLdb as msql
import jsbeautifier
import enchant
import sys
import py2exe
import six
Mydata_files = []

for files in os.listdir('C:\\Users\\agis\\Dropbox\\PyWall\\Files'):
    f1 = 'C:\\Users\\agis\\Dropbox\\PyWall\\Files\\' + files
    if os.path.isfile(f1): # skip directories
       f2 = 'Files', [f1]
       Mydata_files.append(f2)

sys.path.append('C:\\Windows\\WinSxS\\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada')
sys.path.append("C:\\Python27\\Lib\\site-packages")
setup(windows=['pywall.py'],
    data_files = Mydata_files)

If i remove enchant from my script the executable run perfect.How i can include enchant to my exe. 如果我从脚本中删除附魔,则可执行文件将运行完美。如何将附魔包含在我的exe中。

Please see the documentation http://pythonhosted.org/pyenchant/tutorial.html#packaging-pyenchant-with-py2exe 请参阅文档http://pythonhosted.org/pyenchant/tutorial.html#packaging-pyenchant-with-py2exe

"PyEnchant depends on a large number of auxilliary files such as plugin libraries, dictionary files, etc. While py2exe does an excellent job of detecting static file dependencies, it cannot detect these files which are located at runtime. “ PyEnchant依赖于大量辅助文件,例如插件库,字典文件等。虽然py2exe在检测静态文件依赖项方面做得很好,但它无法检测到运行时的这些文件。

To successfully package an application that uses PyEnchant, these auxilliary files must be explicitly included in the “data_files” argument to the setup function. 为了成功打包使用PyEnchant的应用程序,必须在安装函数的“ data_files”参数中明确包含这些辅助文件。 The function enchant.utils.win32_data_files returns a list of files which can be used for this purpose." 函数enchant.utils.win32_data_files返回可用于此目的的文件列表。”

For this issue:----> Py2exe enchant error. 对于此问题:----> Py2exe附魔错误。

You can use the alternative solution, by downloading "language_check 2.x" which can be used to check the grammatical mistakes of your English. 您可以使用替代解决方案,方法是下载“ language_check 2.x”,该语言可用于检查英语的语法错误。 Also, can be used in Py2 & Py3. 另外,可以在Py2和Py3中使用。

https://pypi.org/project/language-check/ https://pypi.org/project/language-check/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM