Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 08-23-2019, 06:57 AM   #1
jefgoi
Junior Member
jefgoi began at the beginning.
 
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?
jefgoi is offline   Reply With Quote
Old 08-23-2019, 02:05 PM   #2
DaltonST
Deviser
DaltonST is the One.DaltonST is the One.DaltonST is the One.DaltonST is the One.DaltonST is the One.DaltonST is the One.DaltonST is the One.DaltonST is the One.DaltonST is the One.DaltonST is the One.DaltonST is the One.
 
DaltonST's Avatar
 
Posts: 1,545
Karma: 101802
Join Date: Aug 2013
Location: Texas
Device: 8" Win10 Tablet w/Calibre64, CalibreSpy & Freda+
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.
DaltonST is offline   Reply With Quote
Old 08-24-2019, 06:52 AM   #3
jefgoi
Junior Member
jefgoi began at the beginning.
 
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?
jefgoi is offline   Reply With Quote
Old 08-24-2019, 12:18 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 35,496
Karma: 12737927
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.
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
install multiple versions, install to ram drive cybmole Sigil 3 01-12-2015 03:13 AM
what to install Areka enTourage eDGe 5 02-22-2014 12:05 PM
360 Plus What should I install on it? Nate the great PocketBook 13 11-24-2011 07:00 AM
PRS-900 Sony Digital Edition Library Install, and Install, ... Hamlet53 Sony Reader 3 04-05-2010 04:29 PM


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


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