View Single Post
Old 01-26-2014, 03:59 PM   #1
geekraver
Addict
geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.
 
Posts: 364
Karma: 1035291
Join Date: Jul 2006
Location: Redmond, WA
Device: iPad Mini,Kindle Paperwhite
Using Beautiful Soup from a plugin

Hi devs

I am working on a plugin for which I want to use Beautiful Soup. However, my plugin fails on the import:

from bs4 import BeautifulSoup

with:

File "calibre_plugins.magazines.bs4.__init__", line 30, in <module>
File "site-packages/calibre/customize/zipplugin.py", line 179, in load_module
File "calibre_plugins.magazines.bs4.builder.__init_ _", line 4, in <module>
ImportError: No module named bs4.element

This is if I bundle bs4 with the plugin. If I don't, and try to rely on the fact that it is installed in my Python distribution, then I get:

File "calibre_plugins.magazines.worker", line 15, in <module>
ImportError: No module named bs4

Has anyone used bs4 in a plugin and have any tips?

Thanks!
geekraver is offline   Reply With Quote