Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 11-21-2017, 08:00 AM   #1
xallios
Junior Member
xallios began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2017
Device: Computer
Exclamation Conversion Error: 'Item' object has no attribute 'xpath'

Trying to convern one of my books from AZW3 format to PDF, and getting the message 'Item' object has no attribute 'xpath'.

Here is the entire error message:


Spoiler:

-----------------------------------------------------------------------

calibre, version 3.12.0 (win32, embedded-python: True)
Conversion error: Failed: Convert book 1 of 1 (The Lean Muscle Diet: A Customized Nutrition and Workout Plan--Eat the Foods You Love to Build the Body You Want and Keep It for Life!)

Convert book 1 of 1 (The Lean Muscle Diet: A Customized Nutrition and Workout Plan--Eat the Foods You Love to Build the Body You Want and Keep It for Life!)
Conversion options changed from defaults:
read_metadata_from_opf: u'C:\\Users\\Kevin\\AppData\\Local\\Temp\\calibre_ ynk6si\\l4en4t.opf'
margin_right: -1.0
remove_fake_margins: False
max_toc_links: 0
verbose: 2
margin_left: -1.0
margin_top: -1.0
cover: u'C:\\Users\\Kevin\\AppData\\Local\\Temp\\calibre_ ynk6si\\xcm0kg.jpeg'
expand_css: True
no_chapters_in_toc: True
disable_font_rescaling: True
pdf_default_font_size: 16
custom_size: u'6.8 x 9.5'
pdf_sans_family: u'Liberation Mono'
keep_ligatures: True
embed_all_fonts: True
output_profile: 'tablet'
input_profile: 'kindle'
margin_bottom: -1.0
minimum_line_height: 0.0
Resolved conversion options
calibre version: 3.12.0
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0.0,
'book_producer': None,
'change_justification': u'original',
'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., '\\s*((chapter|book|section|part)\\s+)|((prolog|pr ologue|epilogue)(\\s+|$))', 'i')) or @class = 'chapter']",
'chapter_mark': u'pagebreak',
'comments': None,
'cover': u'C:\\Users\\Kevin\\AppData\\Local\\Temp\\calibre_ ynk6si\\xcm0kg.jpeg',
'custom_size': u'6.8 x 9.5',
'debug_pipeline': None,
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': True,
'duplicate_links_in_toc': False,
'embed_all_fonts': True,
'embed_font_family': None,
'enable_heuristics': False,
'expand_css': True,
'extra_css': None,
'filter_css': u'',
'fix_indents': True,
'font_size_mapping': None,
'format_scene_breaks': True,
'html_unwrap_factor': 0.4,
'input_encoding': None,
'input_profile': <calibre.customize.profiles.KindleInput object at 0x00000207279F8710>,
'insert_blank_line': False,
'insert_blank_line_size': 0.5,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': True,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0.0,
'linearize_tables': False,
'margin_bottom': -1.0,
'margin_left': -1.0,
'margin_right': -1.0,
'margin_top': -1.0,
'markup_chapter_headings': True,
'max_toc_links': 0,
'minimum_line_height': 0.0,
'no_chapters_in_toc': True,
'no_inline_navbars': False,
'output_profile': <calibre.customize.profiles.TabletOutput object at 0x0000020727A10048>,
'page_breaks_before': u"//*[name()='h1' or name()='h2']",
'paper_size': u'letter',
'pdf_add_toc': False,
'pdf_default_font_size': 16,
'pdf_footer_template': None,
'pdf_header_template': None,
'pdf_mark_links': False,
'pdf_mono_family': u'Liberation Mono',
'pdf_mono_font_size': 16,
'pdf_page_margin_bottom': 72.0,
'pdf_page_margin_left': 72.0,
'pdf_page_margin_right': 72.0,
'pdf_page_margin_top': 72.0,
'pdf_page_numbers': False,
'pdf_sans_family': u'Liberation Mono',
'pdf_serif_family': u'Liberation Serif',
'pdf_standard_font': u'serif',
'prefer_metadata_cover': False,
'preserve_cover_aspect_ratio': False,
'pretty_print': False,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': u'C:\\Users\\Kevin\\AppData\\Local\\Temp\\calibre_ ynk6si\\l4en4t.opf',
'remove_fake_margins': False,
'remove_first_image': False,
'remove_paragraph_spacing': False,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': u'',
'search_replace': '[]',
'series': None,
'series_index': None,
'smarten_punctuation': False,
'sr1_replace': None,
'sr1_search': None,
'sr2_replace': None,
'sr2_search': None,
'sr3_replace': None,
'sr3_search': None,
'start_reading_at': None,
'subset_embedded_fonts': False,
'tags': None,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'toc_title': None,
'transform_css_rules': '[]',
'uncompressed_pdf': False,
'unit': u'inch',
'unsmarten_punctuation': False,
'unwrap_lines': True,
'use_auto_toc': False,
'use_profile_size': False,
'verbose': 2}
InputFormatPlugin: MOBI Input running
on C:\Users\Kevin\AppData\Local\Temp\calibre_ynk6si\w xqyzr.azw3
Found KF8 MOBI of type 'standalone'
Extracting text...
Parsing all content...
Parsing text/part0014.html ...
Parsing text/part0008.html ...
Parsing text/part0026.html ...
Parsing text/part0003.html ...
Parsing text/part0004.html ...
Parsing text/part0015.html ...
Parsing text/part0009.html ...
Parsing text/part0025.html ...
Parsing text/part0020.html ...
Parsing text/part0016.html ...
Parsing text/part0010.html ...
Parsing text/part0024.html ...
Parsing text/part0002.html ...
Parsing text/part0017.html ...
Parsing text/part0011.html ...
Parsing text/part0005.html ...
Parsing text/part0021.html ...
Parsing text/part0023.html ...
Parsing text/part0018.html ...
Parsing text/part0012.html ...
Parsing text/part0006.html ...
Parsing text/part0022.html ...
Parsing text/part0019.html ...
Parsing text/part0013.html ...
Parsing text/part0007.html ...
Parsing styles/0001.css ...
Parsing text/part0001.html ...
Parsing text/part0000.html ...
Reading TOC from NCX...
Merging user specified metadata...
Detecting structure...
Detected chapter: PART ONE:
Detected chapter: PART TWO:
Detected chapter: PART THREE:
Detected chapter: PART FOUR:
Flattening CSS and remapping font sizes...
Source base font size is 16.00000pt
Embedding font Arial Bold from c:\windows\fonts\arialbd.ttf
Python function terminated unexpectedly
'Item' object has no attribute 'xpath' (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\utils\ipc\worker.py", line 195, in main
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 33, in gui_convert_override
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 26, in gui_convert
File "site-packages\calibre\ebooks\conversion\plumber.py", line 1222, in run
File "site-packages\calibre\ebooks\oeb\transforms\embed_fonts .py", line 114, in __call__
File "site-packages\calibre\ebooks\oeb\transforms\embed_fonts .py", line 182, in process_item
File "site-packages\calibre\ebooks\oeb\transforms\embed_fonts .py", line 187, in find_usage_in
File "site-packages\calibre\ebooks\oeb\transforms\embed_fonts .py", line 187, in find_usage_in
File "site-packages\calibre\ebooks\oeb\transforms\embed_fonts .py", line 195, in find_usage_in
File "site-packages\calibre\ebooks\oeb\transforms\embed_fonts .py", line 247, in embed_font
File "site-packages\calibre\ebooks\oeb\transforms\embed_fonts .py", line 236, in do_embed
File "site-packages\calibre\ebooks\oeb\transforms\embed_fonts .py", line 159, in get_page_sheet
AttributeError: 'Item' object has no attribute 'xpath'


-----------------------------------------------------------------------

If someone can help me figure out the problem, I would greatly appreciate it.

Thank you

Last edited by Dr. Drib; 11-21-2017 at 08:05 AM.
xallios is offline   Reply With Quote
Old 11-22-2017, 06:35 AM   #2
xallios
Junior Member
xallios began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2017
Device: Computer
Just tried converting it to EPUB, and getting the same error.
xallios is offline   Reply With Quote
Advert
Old 11-22-2017, 07:18 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 34,562
Karma: 11409476
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That should fix it: https://github.com/kovidgoyal/calibr...b7a67448386094
kovidgoyal is offline   Reply With Quote
Old 11-22-2017, 07:28 AM   #4
xallios
Junior Member
xallios began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2017
Device: Computer
Quote:
Originally Posted by kovidgoyal View Post

Thank you for the reply and potential fix, Kovid. How do I incorporate that fix in the program? I'm assuming if I can find the "embed_fonts.py" file, I can open it in plain text editor and update the file there, right? If so, where is the embed_fonts.py file?
xallios is offline   Reply With Quote
Old 11-22-2017, 07:59 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 34,562
Karma: 11409476
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://manual.calibre-ebook.com/develop.html
kovidgoyal is offline   Reply With Quote
Advert
Old 11-22-2017, 08:32 AM   #6
xallios
Junior Member
xallios began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2017
Device: Computer
Quote:
Originally Posted by kovidgoyal View Post
Ok, I followed the steps under "Windows Development Environment". Ran "echo %CALIBRE_DEVELOP_FROM%" which it returned the value "%CALIBRE_DEVELOP_FROM%". After that, I'm not sure what to do. I can't seem to find the "src" folder after completing the steps. The folders are not listed in File Explorer, nor are they coming up in the command prompt.
xallios is offline   Reply With Quote
Old 11-23-2017, 05:46 AM   #7
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,696
Karma: 13739682
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by xallios View Post
Thank you for the reply and potential fix, Kovid. How do I incorporate that fix in the program?
No need to do anything special, the fix will be in the next release. Or as Kovid pointed out you could run from source.
DoctorOhh is offline   Reply With Quote
Reply

Tags
conversion, error

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error calibre OSX: 'int' object has no attribute 'replace' dorjeduck Calibre 3 11-28-2012 10:53 PM
Adding <guide> produces error: "Nonetype object has no attribute 'lower' MichaelKaufman ePub 2 08-19-2011 06:39 PM
'list' object has no attribute 'add_book' etc. mazzeltjes Calibre 1 12-26-2008 01:12 PM
'BookList' object has no attribute 'add_books' Error message nomedia Calibre 4 09-29-2008 01:50 AM


All times are GMT -4. The time now is 11:19 PM.


MobileRead.com is a privately owned, operated and funded community.