View Single Post
Old 01-26-2014, 04:28 PM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,777
Karma: 206758686
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
1) calibre's python environment already comes with BeautifulSoup, so unless there's an issue with needing a specific version, I'd just import that.

2) Modules included within a plugin's package are only available for import during the "run" method of the plugin (at least that always used to be the case).

2) Import modules using the name of the text-file included in your plugin.

ex: if the filename is "plugin-import-name-my_shiny_plugin.txt" you would use:
Code:
from calibre_plugins.my_shiny_plugin import my_shiny_module
3) You can't rely on modules installed in your machine's Python installation, because calibre doesn't use your Python installation.

Last edited by DiapDealer; 01-26-2014 at 04:44 PM.
DiapDealer is offline   Reply With Quote