View Single Post
Old 01-06-2018, 03:56 PM   #1
einnordlicht
Junior Member
einnordlicht began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jan 2018
Device: none
Problems using Calibre 3.15.0 Database API

Hi,
sorry for the rookie question but I have trouble to get the Calibre database running. I'm trying my first steps to write an external (standalone) python program to extend the Calibre metadata of my Calibre library with some thousands of Amazon books.
The environment is KUbuntu 16.04.3, Calibre 3.15.0. I followed the installation instructions from https://manual.calibre-ebook.com/develop.html and installed a binary Calibre 3.15.0 and the source code from git. Python is 2.7.12.

I try to create a very simple program in the src folder ($CALIBRE_DEVELOP_FROM) and point it to my Calibre test library
Code:
from calibre.library import db
db = db('/home/myuserid/Calibre Library').new_api
but all I get is
Code:
python calibreDbTest.py
Hello, world!
Traceback (most recent call last):
  File "calibreDbTest.py", line 1, in <module>
    from calibre.library import db
  File "/home/myuserid/Nextcloud/work/calibre/src/calibre/__init__.py", line 23, in <module>
    from calibre.startup import winutil, winutilerror
  File "/home/myuserid/Nextcloud/work/calibre/src/calibre/startup.py", line 85, in <module>
    import calibre.utils.resources as resources
  File "/home/myuserid/Nextcloud/work/calibre/src/calibre/utils/resources.py", line 67, in <module>
    _resolver = PathResolver()
  File "/home/myuserid/Nextcloud/work/calibre/src/calibre/utils/resources.py", line 18, in __init__
    self.locations = [sys.resources_location]
AttributeError: 'module' object has no attribute 'resources_location'
/home/myuserid/Nextcloud/work/calibre/src/calibre/ptempfile.py:29: RuntimeWarning: Parent module 'calibre' not found while handling absolute import
  import shutil
Do I miss anything essential here?
Thanks for hints and help
Regards
einnordlicht
einnordlicht is offline   Reply With Quote