![]() |
#1 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78
Karma: 99068
Join Date: Nov 2017
Device: N/A
|
"No module named calibrelibrary.database2" error
Would someone mind helping me troubleshoot the following error please?
Code:
C:\Program Files\Calibre2 >calibre-debug.exe -c "from calibrelibrary.database2 import LibraryDatabase2; db = LibraryDatabase2('c:\Users\Andrew\Calibre\ Library'); db.execute('select * from books b where b.id = 3094');" Python function terminated unexpectedly No module named calibrelibrary.database2 (Error Code: 1) Traceback (most recent call last): File "site.py", line 101, in main File "site.py", line 78, in run_entry_point File "site-packages\calibre\debug.py", line 276, in main File "<string>", line 1, in <module> ImportError: No module named calibrelibrary.database2 |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,037
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Where did you get that commandline (those arguments)?
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,331
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That command line you are using is obsolete. If you want to list the books in the calibre database from the command line use the calibredb tool. https://manual.calibre-ebook.com/gen...calibredb.html
|
![]() |
![]() |
![]() |
#4 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78
Karma: 99068
Join Date: Nov 2017
Device: N/A
|
Quote:
Instead, I am using sqlite to attach to and query the database directly. |
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,331
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibredb supports the full calibre search language, what are yo utrying to achieve?
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78
Karma: 99068
Join Date: Nov 2017
Device: N/A
|
Quote:
In order to do this the script generates a count of all my unread books then generates 10 random numbers and executes a number of queries with the LIMIT 1 clause to select a random book (excluding certain criteria such as custom columns and tags). I am aware of the read random book feature but I wanted something a little different. |
|
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,331
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can do all that with calibredb. Use calibredb search to get the ids of all unread books, with whatever other criteria you need. Have your script pick a random one from that list.
You can also do that in the calibre GUI. Create a Virtual library to show your unread books (virtual libraries are based on arbitrary search expressions). Then the pickk a random book feature will pick a book from that virtual library. |
![]() |
![]() |
![]() |
#8 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78
Karma: 99068
Join Date: Nov 2017
Device: N/A
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
python error: No module named MySQLdb | stgabriel | Development | 1 | 03-10-2013 02:13 PM |
"ImportError: No module named encutils" | lesliek19 | Conversion | 7 | 10-02-2012 08:30 PM |
Calibre 0.8.36 - Linux Compile Error - No module named dateutil.parser | jasn | Calibre | 2 | 01-21-2012 11:36 PM |
Error on install: No module named PyQt4 | good_man | Calibre | 4 | 02-18-2011 03:10 PM |
ebook-meta error - "No module named podofo" | jimrothstein | Calibre | 1 | 01-15-2011 09:58 AM |