Write a guide on running Penelope on Windows
To convert StarDict format to Bookeen on Windows 10 I had to:
- Install Python 2.7.11 MSI to e.g.
C:\Python27, let the folder be added to the PATH variable by the installer - Install prebulit binary lxml-3.6.0.win32-py2.7.exe (md5) for Python 2.7.x
- Install Microsoft Visual C++ Compiler for Python 2.7
- run
pip install --upgrade setuptoolsfromC:\Python27\Scriptsfolder - Deal with the problem described here: http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat For me worked: http://stackoverflow.com/a/28617830/2224701
SET DISTUTILS_USE_SDK=1
SET MSSdk=1
- run
pip install penelope - Copy
collate_default.pyscript from Penelope source code toC:\Python27\Scripts(the place where Penelope compiled appears) ascollate_x.py(different name) - Add at the begining of the file
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
- Then when running penelope, use option
--bookeen-collation collate_x.py - Copy all the stardict files to one zip file in
C:\Python27\Scriptsfolder - Use Penelope script according to help, output file will be created in
C:\Python27\Scripts.
It took me some hours to figure this all, but I am now happy to have a good french english dictionary besides the great built-in Noveau Littré in my Cybook Muse, etc., thanks.
Hi,
thank you for taking time to write the steps down. Please note that most of the difficulty of having Penelope installing on Windows is due to the fact it is hard to compile extensions on Windows (steps 2-6 above).
Also, please note that while lxml and marisa-trie are listed as requirements, in fact if you do not read/write XML and/or Kobo files, you can probably just get the source code of Penelope from GitHub (either with git or using the master ZIP button), and avoid steps 2-6 altogether.
Your step 8 forces Penelope to use UTF-8 encoding for I/O. A better way, which also works in Python 3, consists in setting the environment variable:
SET PYTHONIOENCODING=UTF-8
(albeit I am not sure it really works on Windows). Even better, you can probably avoid it by using a proper shell that uses UTF-8 instead of the default Windows shell (which I believe uses CP1252 or whatever.).
Finally: https://github.com/pettarin/penelope#important-update