0

Hi i compiled my python script that includes enchant and when i try to execute my program i get the following error

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. My setup.py file looks like this

   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.

Agis Soleas
  • 343
  • 1
  • 4
  • 21
  • how did you install [**enchant**](http://pythonhosted.org/pyenchant/tutorial.html#installing-pyenchant)? Did you try to install it from _pip_? – mabe02 Jan 17 '16 at 16:03

2 Answers2

0

Please see the documentation 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.

To successfully package an application that uses PyEnchant, these auxilliary files must be explicitly included in the “data_files” argument to the setup function. The function enchant.utils.win32_data_files returns a list of files which can be used for this purpose."

Dan-Dev
  • 8,957
  • 3
  • 38
  • 55
0

For this issue:----> Py2exe enchant error.

You can use the alternative solution, by downloading "language_check 2.x" which can be used to check the grammatical mistakes of your English. Also, can be used in Py2 & Py3.

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

omar jnb
  • 1
  • 1
  • Are you sure that this link provides a solution? Enchant error is not mentioned anywhere – fgamess Aug 11 '18 at 08:28
  • this is could be an alternative solution to the PyEchant deficiency, where PyEnchant requires win32, and that not always possible. – omar jnb Aug 12 '18 at 11:25