![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Aug 2018
Device: none
|
pip install?
How can I use 3rd party modules, like https://pypi.org/project/pymorphy2/?
In general for local environment I install them with pip, which doesn't look to be possible in calibre python. How? |
![]() |
![]() |
![]() |
#2 |
Deviser
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
Assuming you have already created a personal Calibre GUI-type plugin designed to do what is necessary to interact with pymorphy2, hard-copy the pymorphy2 .py files into a subdirectory of the plugin source-code directory, and then "from xxxxx import ....." them into your plugin for use.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Aug 2018
Device: none
|
Thanks! I found pymorphy2 in sys.path, copied the folder from into my plugin folder, zipped, loaded my plugin into calibre, got error in debug mode:
ImportError: No module named pymorphy2 Any hints here? |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That's a multi file package you wont be able to run it unmodified from inside a zip file, if it does not use relative imports, which older packages like this typically do not.
You could extract it from the zip file, add the extracted folder to sys.path and import it that way. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
install multiple versions, install to ram drive | cybmole | Sigil | 3 | 01-12-2015 02:13 AM |
what to install | Areka | enTourage eDGe | 5 | 02-22-2014 11:05 AM |
360 Plus What should I install on it? | Nate the great | PocketBook | 13 | 11-24-2011 06:00 AM |
PRS-900 Sony Digital Edition Library Install, and Install, ... | Hamlet53 | Sony Reader | 3 | 04-05-2010 03:29 PM |