View Single Post
Old 02-06-2018, 09:53 AM   #1
tsar2512
Junior Member
tsar2512 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Feb 2018
Device: ipad
Running Calibre CLI module, SYS arguments?

I am trying to run Calibre's CLI module directly in python. After cloning the source code from git, I tried the following:


python -m calibre.ebooks.conversion.cli abc.epub abc.pdf


It seems like there are sys. variables being setup in init scripts somewhere, are they being loaded from environment variables? If so, what environment variables do I need to set ?

I already have:
echo $CALIBRE_DEVELOP_FROM
workspace/calibre/src/

The following is the error I get:

Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 151, in _run_module_as_main
mod_name, loader, code, fname = _get_module_details(mod_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 101, in _get_module_details
loader = get_loader(mod_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 464, in get_loader
return find_loader(fullname)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 474, in find_loader
for importer in iter_importers(fullname):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 430, in iter_importers
__import__(pkg)
File "calibre/__init__.py", line 22, in <module>
from calibre.startup import winutil, winutilerror
File "calibre/startup.py", line 85, in <module>
import calibre.utils.resources as resources
File "calibre/utils/resources.py", line 67, in <module>
_resolver = PathResolver()
File "calibre/utils/resources.py", line 18, in __init__
self.locations = [sys.resources_location]
AttributeError: 'module' object has no attribute 'resources_location'
calibre/ptempfile.py:29: RuntimeWarning: Parent module 'calibre' not found while handling absolute import
import shutil
tsar2512 is offline   Reply With Quote