Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 01-17-2020, 08:34 PM   #1
skybook
Enthusiast
skybook began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jan 2020
Device: Kobo Libra H2O
Help with using penelope

Hello!

I am trying to convert a CSV file I made (a tiny dictionary consisting of words and phrases for a specific book series) into a dictionary, and I'm struggling.

Here are the steps I took:

- downloaded Cygwin and installed
- downloaded Python 2.7.17 and installed. Tested from both Cygwin and command prompt, I can use python
-downloaded and installed pip. I can only use pip from command prompt, so will use command prompt moving forward
- using command prompt (run as Administrator), I installed penelope using: pip install penelope


So, to test whether or not it worked, I tried using 'penelope -h" and 'python penelope -h', but neither are working.

What am I doing wrong?
skybook is offline   Reply With Quote
Old 01-17-2020, 11:46 PM   #2
ctop
Connoisseur
ctop herds cats with both ease and gracectop herds cats with both ease and gracectop herds cats with both ease and gracectop herds cats with both ease and gracectop herds cats with both ease and gracectop herds cats with both ease and gracectop herds cats with both ease and gracectop herds cats with both ease and gracectop herds cats with both ease and gracectop herds cats with both ease and gracectop herds cats with both ease and grace
 
Posts: 57
Karma: 43710
Join Date: Jun 2008
Device: zaurus->palm->iPad->Sony PRS-T1,T2,T3->Kobo Forma&Likebook Ares
Quote:
Originally Posted by skybook View Post

So, to test whether or not it worked, I tried using 'penelope -h" and 'python penelope -h', but neither are working.

What am I doing wrong?
What exactly did not work? What did you expect and what result did you see? Was there any error message?

Just poking in the dark...

Chris
ctop is offline   Reply With Quote
Old 01-18-2020, 12:24 AM   #3
rtiangha
Evangelist
rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.
 
Posts: 496
Karma: 356531
Join Date: Jul 2016
Location: 'burta, Canada
Device: Kobo Glo HD
How did you install Python? By downloading the Windows installer from python.org or by using the cygwin installer (they are different, even though you can invoke the Windows version of Python through the cygwin shell if the Windows python binary is in your PATH)?

And what terminal did you install penelope with? The Windows command prompt, or the cygwin shell?

Anyway, in the Windows command prompt, try using python -m penelope -h instead.

Last edited by rtiangha; 01-18-2020 at 12:28 AM.
rtiangha is offline   Reply With Quote
Old 01-18-2020, 10:30 AM   #4
skybook
Enthusiast
skybook began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jan 2020
Device: Kobo Libra H2O
@ctop: I was expecting the help files for penelope to appear, like it says in the README files

@rtianha: I downloaded the Windows installer, and I have no idea why I can invoke python from cygwin.

But you're recommendation worked! I used python -m penelope -h and the help files appeared! What does -m mean? And does this mean I have to always start penelope with python -m penelope?

Also, where should I keep my file for penelope to work? Currently it's saved to my Desktop.
skybook is offline   Reply With Quote
Old 01-18-2020, 10:51 AM   #5
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,735
Karma: 6990705
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by skybook View Post
But you're recommendation worked! I used python -m penelope -h and the help files appeared! What does -m mean? And does this mean I have to always start penelope with python -m penelope?
-m runs a python module.
geek1011 is offline   Reply With Quote
Old 01-18-2020, 11:00 AM   #6
skybook
Enthusiast
skybook began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jan 2020
Device: Kobo Libra H2O
Cool, so then for my command, do I use this?

python -m penelope -i C:\skybook\Desktop\tpdictionary.csv -j csv -f en -t en -p kobo -o C:\skybook\Desktop\tpdictionary.dicthtml
skybook is offline   Reply With Quote
Old 01-18-2020, 11:28 AM   #7
skybook
Enthusiast
skybook began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jan 2020
Device: Kobo Libra H2O
Oh, that is not what happened...

I got a file named dicthtml.zip?
skybook is offline   Reply With Quote
Old 01-18-2020, 07:17 PM   #8
rtiangha
Evangelist
rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.
 
Posts: 496
Karma: 356531
Join Date: Jul 2016
Location: 'burta, Canada
Device: Kobo Glo HD
Quote:
Originally Posted by skybook View Post
Oh, that is not what happened...

I got a file named dicthtml.zip?
I find the -o switch to be inconsistent; sometimes it renames the file, sometimes it doesn't. I'm 90% certain it's a bug, but since penelope is no longer actively developed, I doubt it'll be looked at unless someone else decides to (I'm not strong enough in Python to fix it myself, and I don't have the time at the moment to really teach myself the language or delve deeply into the code to figure out what's going on).

As for cygwin, since the Windows command prompt seems to work well enough, you don't actually need it and can uninstall it. Otherwise, if you wanted to do it all in the cygwin shell, you'd use the cygwin setup.exe file that you used to install cygwin in the first place to also install the cygwin versions of python and python-pip as well (just re-run the .exe file; it'll remember your installation settings), and cygwin will then use those versions instead of the native Windows version. It would save you from having to type in python -m all the time, but probably not much else. You'd probably only want to keep cygwin if you were to use some of the other utilities it offers. If you have no intention to and just want to use penelope, there's really no reason to keep cygwin around either if you're trying to save disk space.

Last edited by rtiangha; 01-18-2020 at 07:30 PM.
rtiangha is offline   Reply With Quote
Old 01-18-2020, 07:36 PM   #9
skybook
Enthusiast
skybook began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jan 2020
Device: Kobo Libra H2O
Cool, I'll probably just uninstall it, then.

Otherwise, the file penelope output is fine for me to sideload? I kinda just deleted it, assuming I did something wrong.
skybook is offline   Reply With Quote
Old 01-18-2020, 07:58 PM   #10
rtiangha
Evangelist
rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.
 
Posts: 496
Karma: 356531
Join Date: Jul 2016
Location: 'burta, Canada
Device: Kobo Glo HD
Quote:
Originally Posted by skybook View Post
Cool, I'll probably just uninstall it, then.

Otherwise, the file penelope output is fine for me to sideload? I kinda just deleted it, assuming I did something wrong.
You can sideload it, either as a replacement of the main English dicthtml.zip dictionary, or if you want to keep that, rename the new one to dicthtml-en-en.zip and I think they'll co-exist together (the new one will be labeled as English-English in the dictionary menu). Otherwise, you'll either have to rename it to one of the onboard foreign language dictionaries and replace it, or follow the instructions in this thread to add extra custom dictionaries.

Keep in mind that if you use one of the default dictionary names, it may get overwritten on the next sync unless you use the dictionary renaming patch (see the kobopatch thread in the dev forum), although that's not a problem if you never connect your reader online.

Whether the file actually works is a different question, lol. But there's only one way to find out.

Last edited by rtiangha; 01-18-2020 at 08:09 PM.
rtiangha is offline   Reply With Quote
Old 01-19-2020, 12:24 AM   #11
skybook
Enthusiast
skybook began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jan 2020
Device: Kobo Libra H2O
Darn! I installed the dictionary as per the same link you posted, but it didn't work. It has to be a problem with the csv file or the command I'm using with penelope, because I managed to successfully install 2 other English dictionaries found on this site (WordNet and Websters)

Anyone have any suggestions? The csv file I created has 2 columns, no header (first column has the word, second has the definition). Here is the link to the csv file in case I messed that up: https://drive.google.com/open?id=1T1...pLmtd2RI7mTOoF
skybook is offline   Reply With Quote
Old 01-19-2020, 02:41 AM   #12
rtiangha
Evangelist
rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.
 
Posts: 496
Karma: 356531
Join Date: Jul 2016
Location: 'burta, Canada
Device: Kobo Glo HD
Quote:
Originally Posted by skybook View Post
Darn! I installed the dictionary as per the same link you posted, but it didn't work. It has to be a problem with the csv file or the command I'm using with penelope, because I managed to successfully install 2 other English dictionaries found on this site (WordNet and Websters)

Anyone have any suggestions? The csv file I created has 2 columns, no header (first column has the word, second has the definition). Here is the link to the csv file in case I messed that up: https://drive.google.com/open?id=1T1...pLmtd2RI7mTOoF
Yeah, I've encountered similar issues when trying to make custom word lists and sometimes things work and sometimes they don't and I can't figure out why (still can't; if anyone can tell me why three separate dictionaries may work well on their own but fail when combining all three, BUT work when any combination of two of them are combined instead and what might be possible reasons, I'm all ears).

I do know that the Kobo dictionary renders in HTML and is thus picky about un-escaped special characters appearing in the headword and/or definition and I don't think Penelope escapes them by default when it encounters them in a conversion. So you could try removing or escaping the various " characters in your definitions (just do a find/replace in a text editor) and retrying the conversion, even though that would make the csv file no longer a true csv file. I'm not sure if the ' characters need to be escaped as well, but you can try doing that as well.

Other ideas is to try converting the csv to a stardict dictionary (either using penelope or pyglossary) and see if the dictionary still works in something like goldendict and/or the original stardict viewer. If not, then that means there might be other issues. If it does work correctly, maybe try converting that stardict version to kobo format instead since that functionality in penelope seems to be better tested.

Last edited by rtiangha; 01-19-2020 at 03:15 AM.
rtiangha is offline   Reply With Quote
Old 01-19-2020, 02:07 PM   #13
skybook
Enthusiast
skybook began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jan 2020
Device: Kobo Libra H2O
Sorry to keep bothering you, but how do I successfully install dictzip? I tried :
- pip install dictzip
- apt-get install dictzip
...and it didn't work :/
skybook is offline   Reply With Quote
Old 01-19-2020, 02:21 PM   #14
rtiangha
Evangelist
rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.
 
Posts: 496
Karma: 356531
Join Date: Jul 2016
Location: 'burta, Canada
Device: Kobo Glo HD
Quote:
Originally Posted by skybook View Post
Sorry to keep bothering you, but how do I successfully install dictzip? I tried :
- pip install dictzip
- apt-get install dictzip
...and it didn't work :/
You need to download a dictzip.exe version compiled for Windows (here's one) and place it somewhere in your PATH. It's probably easiest to put it in C:\\Windows\system32.

Or alternatively, if you were to go the cygwin route, I think there may be a copy in its repositories. If so, you'd install it the same way you'd install cygwin python and python-pip.

Last edited by rtiangha; 01-19-2020 at 02:31 PM.
rtiangha is offline   Reply With Quote
Old 01-19-2020, 05:16 PM   #15
skybook
Enthusiast
skybook began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jan 2020
Device: Kobo Libra H2O
Thanks for the link! I downloaded it to the path you recommended (\Windows\system32), but where do I put the PATH info? There is no penelope.py file that I could find.
skybook is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MemoryError using Penelope michael.scott Workshop 0 12-24-2019 12:40 PM
Please help with converting dicts with Penelope ? khahoon Workshop 18 04-22-2019 12:04 AM
help with penelope OS X MGlitch Kobo Developer's Corner 6 07-12-2017 04:54 PM
Other Fiction Walton, Amy: Penelope and the Others. v1. 25 May 2014 crutledge Kindle Books 0 05-25-2014 09:42 AM
Other Fiction Walton, Amy: Penelope and the Others. v1. 25 May 2014 crutledge BBeB/LRF Books 0 05-25-2014 09:39 AM


All times are GMT -4. The time now is 09:09 AM.


MobileRead.com is a privately owned, operated and funded community.