Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-23-2019, 05: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, 01:05 PM   #2
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
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.
DaltonST is offline   Reply With Quote
Advert
Old 08-24-2019, 05: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, 11:18 AM   #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: 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.
kovidgoyal is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 11:54 PM.


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