01-17-2020, 08:34 PM | #1 |
Enthusiast
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? |
01-17-2020, 11:46 PM | #2 | |
Connoisseur
Posts: 57
Karma: 43710
Join Date: Jun 2008
Device: zaurus->palm->iPad->Sony PRS-T1,T2,T3->Kobo Forma&Likebook Ares
|
Quote:
Just poking in the dark... Chris |
|
01-18-2020, 12:24 AM | #3 |
Evangelist
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. |
01-18-2020, 10:30 AM | #4 |
Enthusiast
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. |
01-18-2020, 10:51 AM | #5 |
Wizard
Posts: 2,735
Karma: 6990705
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
|
|
01-18-2020, 11:00 AM | #6 |
Enthusiast
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 |
01-18-2020, 11:28 AM | #7 |
Enthusiast
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? |
01-18-2020, 07:17 PM | #8 | |
Evangelist
Posts: 496
Karma: 356531
Join Date: Jul 2016
Location: 'burta, Canada
Device: Kobo Glo HD
|
Quote:
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. |
|
01-18-2020, 07:36 PM | #9 |
Enthusiast
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. |
01-18-2020, 07:58 PM | #10 | |
Evangelist
Posts: 496
Karma: 356531
Join Date: Jul 2016
Location: 'burta, Canada
Device: Kobo Glo HD
|
Quote:
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. |
|
01-19-2020, 12:24 AM | #11 |
Enthusiast
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 |
01-19-2020, 02:41 AM | #12 | |
Evangelist
Posts: 496
Karma: 356531
Join Date: Jul 2016
Location: 'burta, Canada
Device: Kobo Glo HD
|
Quote:
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. |
|
01-19-2020, 02:07 PM | #13 |
Enthusiast
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 :/ |
01-19-2020, 02:21 PM | #14 | |
Evangelist
Posts: 496
Karma: 356531
Join Date: Jul 2016
Location: 'burta, Canada
Device: Kobo Glo HD
|
Quote:
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. |
|
01-19-2020, 05:16 PM | #15 |
Enthusiast
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.
|
|
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 |