Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

Ticket #12 (new enhancement)

Opened 6 years ago

Last modified 3 months ago

Hook for collecting files for PyEnchant

Reported by: openticket Owned by: matysek
Priority: low Milestone: PyInstaller 2.2
Component: Hooks Version:
Severity: minor Keywords:
Cc:

Description

I've added PyEnchant?-1.3.0 to my program and cannot get PyInstaller? 1.3 to package it. PyEnchant? stores its dictionaries in C: \Python24\Lib\site-packages\enchant\share\enchant\myspell\. The files in here are plain text files: en_US.dic, en_US.aff, etc. ...

I finally found what I need to do. For the record, from http://sourceforge.net/mailarchive/forum.php?thread_name=45346C4B.507... "You need to copy both the "share" and "lib" dirs from the enchant site-packages directory nto the dir of the exe. "share" contains the dictionaries themselves, while "lib" contains the enchant myspell plugin."

And Giovanni Bajo wrote:

OK. That can be taken care of using a setup program like InnoSetup?.

Anyway, I would like this to be fixed automatically by PyInstaller?. There is much infrastructure in place to pack trees of data files into the executable, unpack automatically them at startup, and let the package find them. This is the way the Tkinter support works, for instance.

Alas, that support is currently hardcoded for Tkinter. It would have to be generalized, so that one can write something like an extended import hook to handle that. It's not that hard to do, but I don't have time right now to do it.

But I would appreciate if you could open a ticket on the website reporting the exact problem and the findings you reported on the mailing list. This will make sure I won't forget about this, and I'll eventually have this fixed.

Attachments

Change History

comment:1 Changed 2 years ago by htgoebel

  • Priority changed from normal to low
  • Version changed from PyInstaller 1.2 to PyInstaller 1.3
  • Type changed from defect to enhancement
  • Severity changed from normal to minor

comment:2 Changed 2 years ago by htgoebel

  • Summary changed from Using PyInstaller 1.3 with PyEnchant-1.3.0 to Hook for collection files for PyEnchant

comment:3 Changed 2 years ago by htgoebel

  • Summary changed from Hook for collection files for PyEnchant to Hook for collecting files for PyEnchant

comment:4 Changed 2 years ago by htgoebel

  • Version PyInstaller 1.3 deleted

comment:5 Changed 2 years ago by matysek

  • Milestone set to PyInstaller 1.6

comment:6 Changed 2 years ago by matysek

From pyenchat website:

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.

comment:7 Changed 23 months ago by matysek

  • Owner changed from giovannibajo to matysek
  • Status changed from new to assigned

comment:8 follow-up: ↓ 10 Changed 23 months ago by matysek

For windows hook is implemented in r1470.

comment:9 follow-up: ↓ 13 Changed 23 months ago by matysek

On Mac OS X pyenchant from macports didn't detect hunspell dictionaries automatically. It is necessary to do the following:

enchant.set_param('enchant.myspell.dictionary.path', '/opt/local/share/hunspell')

comment:10 in reply to: ↑ 8 Changed 22 months ago by matysek

Replying to matysek:

For windows hook is implemented in r1470.

However it will work only for pyenchant >= 1.6

comment:11 Changed 20 months ago by matysek

  • Component changed from PyInstaller to Hooks

comment:12 Changed 20 months ago by htgoebel

r1671 implements

  1. a fall-back for enchant < 1.6
  2. a way for extending the hook (may be used for OS X)

comment:13 in reply to: ↑ 9 Changed 20 months ago by htgoebel

Replying to matysek:

On Mac OS X pyenchant from macports didn't detect hunspell dictionaries automatically. It is necessary to do the following:

enchant.set_param('enchant.myspell.dictionary.path', '/opt/local/share/hunspell')

Do wee have to add this somewhere in the hook or is this just a hint for a recipe?

comment:14 Changed 19 months ago by htgoebel

For the record: Code is at <https://github.com/rfk/pyenchant/>

comment:15 Changed 14 months ago by htgoebel

  • Milestone changed from PyInstaller 2.0 to PyInstaller 2.1

Rescheduling "enhancements" to release 2.1

comment:16 Changed 3 months ago by matysek

  • Status changed from assigned to new
  • Milestone changed from PyInstaller 2.1 to PyInstaller 2.2
View

Add a comment

Modify Ticket

Action
as new
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.