LyXLyx 2.1.2 OSX Yosemite

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
ismyth
Posts: 1
Joined: Wed Oct 29, 2014 12:35 am

Lyx 2.1.2 OSX Yosemite

Post by ismyth »

Hi

I have being using Lyx on my mac for years but with the new upgrade, I started having "Error converting to loadable format" when inserting PDF images in Lyx.

I reinstalled ImageMagick etc. and discovered that when I run lyx from from the command line (bash shell) the error does not happen. If I run Lyx from finder or Spotlight it reappears.

I debugged the loading and below you can see the failure when convertDefault.py is called
As I said running lyx from command line results in "graphics/GraphicsCacheItem.cpp (264): Image conversion succeeded."

thanks
Ivan
-----------------------------------------------------------------------------------------------------
graphics/GraphicsConverter.cpp (128): Converter c-tor:
from_file: /Users/itsmyth/Dropbox/tex.pdf
to_file_base: /var/folders/yb/qkmvm7z12l5gyj1rqrkf8b6c0000gn/T/lyx_tmpdir.YvTyrPzC8387/CacheItem.bYVLLQHm8387
from_format: pdf6
to_format: ppm
graphics/GraphicsConverter.cpp (273): build_script ...
graphics/GraphicsConverter.cpp (340): No converter defined! I use convertDefault.py
python -tt "/Applications/LyX.app/Contents/Resources/scripts/convertDefault.py" pdf:' + '"' + infile + '"' + ' ppm:' + '"' + outfile + '"' + '
graphics/GraphicsConverter.cpp (398): ready!
graphics/GraphicsConverter.cpp (143): Conversion script:
--------------------------------------
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, shutil, sys

def unlinkNoThrow(file):
''' remove a file, do not throw if an error occurs '''
try:
os.unlink(file)
except:
pass

infile = "/Users/itsmyth/Dropbox/tex.pdf"
outfile = "/var/folders/yb/qkmvm7z12l5gyj1rqrkf8b6c0000gn/T/lyx_tmpdir.YvTyrPzC8387/gconvertXq8387.pdf"
shutil.copy(infile, outfile)
os.chdir("/var/folders/yb/qkmvm7z12l5gyj1rqrkf8b6c0000gn/T/lyx_tmpdir.YvTyrPzC8387/")
infile = outfile
outfile = "/var/folders/yb/qkmvm7z12l5gyj1rqrkf8b6c0000gn/T/lyx_tmpdir.YvTyrPzC8387/CacheItem.bYVLLQHm8387.ppm"

if os.system(r'python -tt "/Applications/LyX.app/Contents/Resources/scripts/convertDefault.py" pdf:' + '"' + infile + '"' + ' ppm:' + '"' + outfile + '"' + '') != 0:
unlinkNoThrow(outfile)
sys.exit(1)

if not os.path.isfile(outfile):
if os.path.isfile(outfile + '.0'):
os.rename(outfile + '.0', outfile)
import glob
for file in glob.glob(outfile + '.?'):
unlinkNoThrow(file)
else:
sys.exit(1)

if infile != outfile:
unlinkNoThrow(infile)

fromfile = outfile
tofile = "/var/folders/yb/qkmvm7z12l5gyj1rqrkf8b6c0000gn/T/lyx_tmpdir.YvTyrPzC8387/CacheItem.bYVLLQHm8387.ppm"

try:
os.rename(fromfile, tofile)
except:
try:
shutil.copy(fromfile, tofile)
except:
sys.exit(1)
unlinkNoThrow(fromfile)

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

support/ForkedCalls.cpp (498): ForkedCallQueue: waking up
graphics/GraphicsLoader.cpp (126): LoaderQueue: I'm going to sleep
support/ForkedCalls.cpp (507): ForkedCallQueue: I'm going to sleep
graphics/GraphicsCacheItem.cpp (264): Image conversion failed.
graphics/GraphicsCacheItem.cpp (274): Unable to find converted file!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply