Skip to content
This repository has been archived by the owner on Aug 18, 2018. It is now read-only.

Write a guide on running Penelope on Windows #3

Open
pettarin opened this issue Feb 22, 2015 · 2 comments
Open

Write a guide on running Penelope on Windows #3

pettarin opened this issue Feb 22, 2015 · 2 comments

Comments

@pettarin
Copy link
Owner

No description provided.

@Karluzo
Copy link

Karluzo commented Apr 19, 2016

To convert StarDict format to Bookeen on Windows 10 I had to:

  1. Install Python 2.7.11 MSI to e.g. C:\Python27, let the folder be added to the PATH variable by the installer
  2. Install prebulit binary lxml-3.6.0.win32-py2.7.exe (md5) for Python 2.7.x
  3. Install Microsoft Visual C++ Compiler for Python 2.7
  4. run pip install --upgrade setuptools from C:\Python27\Scripts folder
  5. 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
  1. run pip install penelope
  2. Copy collate_default.py script from Penelope source code to C:\Python27\Scripts (the place where Penelope compiled appears) as collate_x.py (different name)
  3. Add at the begining of the file
import sys
reload(sys)
sys.setdefaultencoding("utf-8")

as per here

  1. Then when running penelope, use option --bookeen-collation collate_x.py
  2. Copy all the stardict files to one zip file in C:\Python27\Scripts folder
  3. 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.

@pettarin
Copy link
Owner Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants