Fixing textext on Inkscape 0.48
I encounter one problem today. My textext didn’t work on Inkscape 0.48, I get the error
textext.py:55: DeprecationWarning: the md5 module is deprecated; use hashlib instead import os, sys, tempfile, traceback, glob, re, md5, copy Traceback (most recent call last): File "textext.py", line 306, in <module> raise RuntimeError("Neither pygtk nor Tkinter is available!") RuntimeError: Neither pygtk nor Tkinter is available!
The error is due to a module depreciated on the python version used on Inkscape, and that Textext uses. However, it was pretty easy to solve.
- First you need to download the python packages that are missing, thanks to David Gleich whom packed everything together, avoiding us the trouble of download them and put the pieces together.
- Unzip them
C:\Program Files\Inkscape\python\Lib\site-packages
Then you need to update your textext files, thanks to Pascal Schulthess for the solution.
- Go to
C:\Program Files\Inkscape\share\extensions
, and opentextext.py
file - Now replace
import inkex import os, sys, tempfile, traceback, glob, re, md5, copy from lxml import etree
and replace it for
import inkex import os, sys, tempfile, traceback, glob, re, copy import hashlib from lxml import etree
- And replace this
def __init__(self, document): PdfConverterBase.__init__(self, document) self.hash = None def convert(self, *a, **kw): # compute hash for generating unique ids for sub-elements self.hash = md5.new('%s%s' % (a, kw)).hexdigest()[:8] return PdfConverterBase.convert(self, *a, **kw) def pdf_to_svg(self): exec_command(['pdf2svg', self.tmp('pdf'), self.tmp('svg'), '1'])
for
def __init__(self, document): PdfConverterBase.__init__(self, document) self.hash = None USE_GTK = False def convert(self, *a, **kw): # compute hash for generating unique ids for sub-elements m = hashlib.md5() m.update('%s%s' % (a, kw)) self.hash = m.hexdigest()[:8] return PdfConverterBase.convert(self, *a, **kw) def pdf_to_svg(self): exec_command(['pdf2svg', self.tmp('pdf'), self.tmp('svg'), '1'])
Restart Inkscape and that would do the work.
Hi,
I have tried your solution and it minimized the errors. Nevertheless it says now:
File “textext.py”, line 870
def __init__(self, document):
^
IndentationError: unindent does not match any outer indentation level
Do you have any suggestions on what might be wrong? The line 870 is line 868 in your code.
Greetings
Python is very picky about indenting. make sure that in each codeblock you have the same indentation. Use spaces as opposed to tabs. Compare ou inserted code to the other functions and adjust the indentation accordingly.
So, having followed these instructions I can get rid of the first complaint re: hashlib. But I’m still getting:
File “textext.py”, line 307, in
raise RuntimeError(“Neither pygtk nor Tkinter is available!”)
RuntimeError: Neither pygtk nor Tkinter is available!
Any advice?
Probably it is because the python in Inkscape is not updated, try to to replace the files with the download files I explain in the post.
On my computer the replacement of files needed administrator rights. The way I could replace the files was the following. First I extracted the files into a temporary folder, and then copied the extracted files into the necessary folder named in the original post. Before completing the action Windows Explorer notified me that administrator rights are needed, and I had to click proceed. (The self-extraction straight away in the necessary folder did not work, the old files probably weren’t replaced by the new ones, and I didn’t get a notification, and I kept receiving the error from Inkscape.)
hallo , i have already replaced the files, but this error persists. for my PC i have installed python 3.4 before, does it matter?
Hi! For those who might interest, I had the same problem after following all the procedure, I still got the error:
File “textext.py”, line 307, in
raise RuntimeError(“Neither pygtk nor Tkinter is available!”)
RuntimeError: Neither pygtk nor Tkinter is available!
I was using the latest 0.91 version of Inkscape, when I replaced it with the older 0.48 version, the problem was solved and the TexText extension worked just fine 🙂
Hi I had the same issue. For me it was, once again, a 32bit/64bit incompatibility!
I uninstalled Inkscape(0.91) 64 Bit and reinstalled Inkscape(0.91) 32 Bit and it worked fine. I Believe this is because 32bit python _glib.pyd refers to 64bit libglib.dll in Inkscape installation directory.
In a general manner, try to comment the lines in textext.py :
# try: # Comment this line
import pygtk
pygtk.require(‘2.0’)
import gtk
USE_GTK = True
# except ImportError: # Comment this line
# pass # Comment this line
So that you will have a clearer meaning of what’s the error.
Hope it helps!
Cheers, it’s fixed now. I forgot to put the files where I needed them…
Thank you for good information. TexText works now.
thanks, now latex works fine under inkscape 0.48 (I use portable inkscape from http://portableapps.com/)
Before doing the modification, these packages should be install on the system:
1,install Miktex, then the pdflatex.exe should be in the PATH
2,install gs902w32.exe, download from http://code.google.com/p/ghostscript/, gswin32.exe should in PATH
3,install pstoeditsetup350.exe, and pstoedit.exe should in PATH
4,install textext-0.4.4.exe
5,do the modifications as you mentioned.
Then, every thing works fine. thanks.
I did all the procedure you described but i have this error:
textext.py:227: GtkWarning: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)’ failed
txt.get_buffer().set_text(err_msg)
Do you know how can i solve it?
Many thanks in advance
Michele
Many Many thanks! that help me a lot!
It is very interesting. But I still don’t fix this problem. Could you describe your install in details. I installed Python 2.5.4, pstoedit and textext extension. Then I did what you said in your post. But the problem still exists!
Did you use the packages in the links?
If you use those, there is no need to install other things. Everything comes in those packages.
If you did, the other thing that comes to my mind is that previous installation are giving problem. Try to check which python inkscape is looking for.
Hai i have followed the procedure but i am getting the following error
Traceback (most recent call last):
File “textext.py”, line 211, in cb_ok
self.callback(self.text, self.preamble_file, self.scale_factor)
File “textext.py”, line 370, in
converter_cls, old_node))
File “textext.py”, line 388, in do_convert
new_node = converter.convert(text, preamble_file, scale_factor)
File “textext.py”, line 756, in convert
new_node = self.svg_to_group()
File “textext.py”, line 778, in svg_to_group
tree = etree.parse(self.tmp(‘svg’))
File “lxml.etree.pyx”, line 2692, in lxml.etree.parse (src/lxml/lxml.etree.c:49594)
File “parser.pxi”, line 1500, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:71364)
File “parser.pxi”, line 1529, in lxml.etree._parseDocumentFromURL (src/lxml/lxml.etree.c:71647)
File “parser.pxi”, line 1429, in lxml.etree._parseDocFromFile (src/lxml/lxml.etree.c:70742)
File “parser.pxi”, line 975, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:67740)
File “parser.pxi”, line 539, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:63824)
File “parser.pxi”, line 625, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:64745)
File “parser.pxi”, line 565, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:64088)
XMLSyntaxError: Document is empty, line 1, column 1
could you please help in this matter
Hi, I had a similar problem, and it turned out that my 32-bit pstoedit refused to work with 64-bit version of ghostscript. Installing 64-bit version of pstoedit fixed the problem for me, maybe you should check if your tools are all 32-bit / 64-bit.
Thank you for the reply. It worked for me
I can confirm that this fixes the error mentioned.
Hi,
I follow exactly as it said. And I was extremely careful about the indent and space.
But I still got this error,
File “textext.py”, line 872
USE_GTK = False
^
IndentationError: unexpected indent
Could you please help in this manner
Did you check this?
You have to indent the commands with SPACES not with TAB, be careful
Awesome post. Solved my problem in 5 minutes. Gracias
De nada…
I’m glad it helps…
Thanks to all the great posts I got to the point of entering some TeX inputs.
But when I enser something like $a$ or anything normal TeX input and press “OK” I get this stream of error messages:
Traceback (most recent call last):
File “textext.py”, line 211, in cb_ok
self.callback(self.text, self.preamble_file, self.scale_factor)
File “textext.py”, line 370, in
converter_cls, old_node))
File “textext.py”, line 390, in do_convert
converter.finish()
File “textext.py”, line 680, in finish
self.remove_temp_files()
File “textext.py”, line 737, in remove_temp_files
self.try_remove(self.tmp_path)
File “textext.py”, line 744, in try_remove
os.rmdir(filename)
WindowsError: [Error 145] : ‘c:\\docume~1\\mingshey\\locals~1\\temp\\tmpw1uq17’
Hi! I´m in the same point and i´ve similar errors
Traceback (most recent call last):
File “textext.py”, line 211, in cb_ok
self.callback(self.text, self.preamble_file, self.scale_factor)
File “textext.py”, line 370, in
converter_cls, old_node))
File “textext.py”, line 388, in do_convert
new_node = converter.convert(text, preamble_file, scale_factor)
File “textext.py”, line 751, in convert
self.tex_to_pdf(latex_text, preamble_file)
File “textext.py”, line 730, in tex_to_pdf
raise RuntimeError(“pdflatex didn’t produce output”)
RuntimeError: pdflatex didn’t produce output
When I rummage the directory ‘c:\\docume~1\\mingshey\\locals~1\\temp\\tmpw1uq17′ and open the texput.log file which reports the error:
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (Web2C 2011) (format=pdflatex 2011.10.3) 3 OCT 2011 21:04
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**c:\docume~1\mingshey\locals~1\temp\tmpawgi2e\tmp.tex -interaction=nonstopmode
-halt-on-error
! Emergency stop.
c:\docume
~1\mingshey\locals~1\temp\tmpawgi2e\tmp.tex -interaction=nonsto…
End of file on the terminal!
Here is how much of TeX’s memory you used:
1 string out of 493633
83 string characters out of 3145073
49245 words of memory out of 3000000
3405 multiletter control sequences out of 15000+200000
3640 words of font info for 14 fonts, out of 3000000 for 9000
831 hyphenation exceptions out of 8191
0i,0n,0p,1b,6s stack positions out of 5000i,500n,10000p,200000b,50000s
! ==> Fatal error occurred, no output PDF file produced!
I overlooked the issue with TeX Live. I was working with TeXLive and now I see I have to download MikTeX.
Thanks for all the help!
Hey,
First of all thanks a lot. It solved a few errors, but now there are new ones:
Traceback (most recent call last):
File “textext.py”, line 937, in
e.affect()
File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect
self.effect()
File “textext.py”, line 349, in effect
% ‘;\n’.join(converter_errors))
RuntimeError: No Latex -> SVG converter available:
Pdf2Svg: Command pdf2svg failed: [Error 2] Das System kann die angegebene Datei nicht finden;
PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] Das System kann die angegebene Datei nicht finden;
SkConvert: Command pstoedit failed: [Error 2] Das System kann die angegebene Datei nicht finden
Sorry for the german parts. There is just standing, that the system cannot find the files. I tried to fix this problem without success. Maybe somebody can help me.
Greetz, duckfunny
Hello Duck funny. I am exactly getting the same errors as yours:
Traceback (most recent call last):
File “textext.py”, line 936, in
e.affect()
File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect
self.effect()
File “textext.py”, line 349, in effect
% ‘;\n’.join(converter_errors))
RuntimeError: No Latex -> SVG converter available:
Pdf2Svg: Command pdf2svg failed: [Error 2] The system cannot find the file specified;
PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] The system cannot find the file specified;
SkConvert: Command pstoedit failed: [Error 2] The system cannot find the file specified
Kindly help me with the solution.
I fixed this by added the pstoedit path to the path system variable.
Ok, now the latex-formula is working somehow, there are still errors but i get my latextext. I followed this [url=http://en.wikiversity.org/wiki/User:Egm6341.s10.team3.heejun/Inkscape]this[\url] to fix the problem above. But now there is the next problem. After the dialog box for textext following error happens:
textext.py:177: GtkWarning: Attempting to store changes into `C:\Programme\HOME\.recently-used.xbel’, but failed: Datei »C:\Programme\HOME\.recently-used.xbel.95WE3V« konnte nicht angelegt werden: Permission denied
gtk.main()
textext.py:177: GtkWarning: Attempting to set the permissions of `C:\Programme\HOME\.recently-used.xbel’, but failed: Permission denied
gtk.main()
Anyone an idea what to do?
Greetz, duckfunny
Hi, that looks like you have some issues with your folder permissions. Try to see if the “Read Only” option is marked. Then, uncheck it.
Hey, thank you for your quick answer! Thats solved the errors by Latex-Formula. This works now fine. TexText says me now: “Error when examining the file C:\Programme\HOME with fstat(): No such file or directory”. When I ignore this message and use the textext dialog box to create latex signs it seems to be working but nothing appears. greetz
Thank you very much for this post, it solved my issues within minutes.
Since the original author does not seem to maintain textext any more, would it be interesting to take textext and your fix to start a branch?
How to configure texText for inkscape 0.48 version on Linux PC?
Hi, I haven’t try to use this fix in a Linux box. But, the issues are related to python. So you may start looking in there.
Try to replace the code, as explained. And then pray that your version of python works. I’m not sure if Inkscape uses the python installed in Linux or it uses its own, like Windows. You should try to change it so it includes the latest versions.
Good luck in your endeavor.
This immediately fixed my problem, thank you so much!!
Thanks for the instructions!
It seems to have solved most of the problems only now I get an error from windows regarding pstoedit, “The application was unable to start correctly (0xc000007b)” consequently inkscape returns an IO error, presumably as it’s looking for something that pstoedit should have created.
Traceback (most recent call last):
File “eqtexsvg.py”, line 156, in
e.affect()
File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect
self.effect()
File “eqtexsvg.py”, line 150, in effect
svg_open(self, svg_file)
File “eqtexsvg.py”, line 81, in svg_open
doc = inkex.etree.parse(filename)
File “lxml.etree.pyx”, line 2692, in lxml.etree.parse (src/lxml/lxml.etree.c:49594)
File “parser.pxi”, line 1500, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:71364)
File “parser.pxi”, line 1529, in lxml.etree._parseDocumentFromURL (src/lxml/lxml.etree.c:71647)
File “parser.pxi”, line 1429, in lxml.etree._parseDocFromFile (src/lxml/lxml.etree.c:70742)
File “parser.pxi”, line 975, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:67740)
File “parser.pxi”, line 539, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:63824)
File “parser.pxi”, line 625, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:64745)
File “parser.pxi”, line 563, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:64060)
IOError: Error reading file ‘c:\users\jamesd~1\appdata\local\temp\inkscape-zs_jeu\eq.svg’: failed to load external entity “file:///c:/users/jamesd~1/appdata/local/temp/inkscape-zs_jeu/eq.svg”
Any help would be much appreciated!
Hello,
Thanks for explanation, but I have the same problem described here :
Thanks for your help!
It worked perfectly for me. Although at first I encountered some errors, I removed all the modifications and modified the file again very carefully… Indentations and spaces are very sensitive in this sort of file I suppose. Therefore, edit the lines one by one in each section and when you’re copy pasting, have an extra eye for your selection. thank you author again!
can you help me with error message after following your solutions:
Traceback (most recent call last):
File “textext.py”, line 212, in cb_ok
self.callback(self.text, self.preamble_file, self.scale_factor)
File “textext.py”, line 371, in
converter_cls, old_node))
File “textext.py”, line 389, in do_convert
new_node = converter.convert(text, preamble_file, scale_factor)
File “textext.py”, line 753, in convert
self.pdf_to_svg()
File “textext.py”, line 767, in pdf_to_svg
raise NotImplementedError
NotImplementedError
I had the same Error, installing the new version of TexText + ImageMagic fixed it (https://bitbucket.org/pitgarbe/textext). GL
Hello people from WordPress… Check this solution… It worked for me and now I have TeXtext running with Inkscape 0.48 without errors (In Linux of course….):
http://gaortizg.wordpress.com/2012/01/29/how-to-write-with-latex-in-inkscape/
See you later…..
I have all these paths entered, but still get the same error message, but in english:
Traceback (most recent call last):
File “textext.py”, line 937, in
e.affect()
File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect
self.effect()
File “textext.py”, line 349, in effect
% ‘;\n’.join(converter_errors))
RuntimeError: No Latex -> SVG converter available:
Pdf2Svg: Command pdf2svg failed: [Error 2] The system cannot find the file specified;
PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] The system cannot find the file specified;
SkConvert: Command pstoedit failed: [Error 2] The system cannot find the file specified
Maybe I should also mention that
1.
I also added
“C:\Program Files\gs\gs9.02\bin\”;”C:\Program Files\gs\gs9.02\lib”;
into the PATH
2.
I also followed all the instructions on
http://en.wikiversity.org/wiki/User:Egm6341.s10.team3.heejun/Inkscape
Sometimes it is hard to know which versions of software to chose, e.g. with GraphicsMagick we have Q8 and Q16 and I do not really understand the difference.
3.
The errors remained.
4.
Then i typed in the entire path to PDF2SVG in the textext.PY file.
Then my new error message at least change a bit. But I do not know if it is good or bad.
Se below:
Traceback (most recent call last):
File “textext.py”, line 937, in
e.affect()
File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect
self.effect()
File “textext.py”, line 349, in effect
% ‘;\n’.join(converter_errors))
RuntimeError: No Latex -> SVG converter available:
Pdf2Svg: Command C:\Program Files (x86)\pdf2svg\pdf2svg failed (code 0):
PDFTron PDF2SVG V5.10.
Copyright (c) 2002-2010 PDFTron Systems Inc., http://www.pdftron.com.
You are running a DEMO version of PDF2SVG.
The demo version has several limitations. Please consult the documentation for details.
Usage: pdf2svg [] file…
OPTIONS:
–file… arg A list of folders and/or file names to process.
-o [ –output ] arg The output folder used to store modified files.
By default, the current working folder will be
used to store converted files.
–subfolders Process all subfolders.
–prefix arg The prefix for the output image file. The output
filename will be constructed by concatenating
the prefix string, the page number,and the
appropriate extension (e.g. myfile_01.svg,
myfile_02.svg, etc).The prefix option should be
used only for conversion of individual
documents. By default, each input filename will
be used as a prefix.
–digits arg The number of digits used in the page counter
portion of the output filename.
-a [ –pages ] arg (=-) Specifies the list of pages to convert. By
default, all pages are converted.
–svgz Compress output SVG files using SVGZ. By
default, generated SVG output is not compressed.
-i [ –embedimages ] Embeds all images. By default, all images are
saved as external files.
–nofonts Disables conversion of font data to SVG. By
default, all available fonts are converted to
SVG.
–nounicode Disables mapping of text to public Unicode
region. Instead text will be converted using a
custom encoding. By default, all text is mapped
to Unicode.
-b [ –box ] arg (=crop) Specifies the page box/region to use for
clipping. Possible values are:
media
crop
trim
bleed
art
The default is page crop region.
-c [ –crop ] arg User definable crop box to be used as a top
level clip region in the output SVG. By default,
the clip region is identical to currently
selected page ‘box’.
–noclip Disables page clipping. Any content outside of
page boundaries will be visible. By default, all
pages are clipped.
–noannots Disables conversion of form fields and
annotations.
–noxmldoc Disables generation of the XML wrapper document.
–thumbsize arg (=100) The dimension of thumbnail image in pixels. By
default, PDF2SVG will generate 100×100
thumbnails.
–nothumbs Disables generation of thumbnail images.
–asv_css_patch Some versions of the Adobe SVG viewer fail to
read valid CSS font properties. As a result,
this option was created as a workaround for this
bug in the Adobe SVG Viewer. Please note that
using this option may cause problems with other
SVG viewers.
–individual_char_placement Some viewers do not support the default text
positioning correctly. This option works around
this issue to place text correctly, but produces
verbose output. This option will override
–remove_char_placement.
–remove_char_placement Disable the output of character positions. This
will produce slightly smaller output files than
the default setting, but many viewers do not
support the output correctly.
–noprompt Disables any user input. By default, the
application will ask for a valid password if the
password is incorrect.
-p [ –pass ] arg The password for secured PDF files. Not required
if the input document is not secured using the
‘open’ password.
–extension arg (=.pdf) The default file extension used to process PDF
documents. The default extension is “.pdf”.
–verb arg (=1) Set the opt.m_verbosity level to ‘arg’ (0-2).
-v [ –version ] Print the version information.
-h [ –help ] Print a listing of available options.
Examples:
pdf2svg -o test_out/ex1 “PDFTron PDF2SVG User Manual.pdf”
pdf2svg -o test_out/ex2 –svgz –nothumbs –noxmldoc -i .
pdf2svg -o test_out/ex3 -p mypass secret.pdf
pdf2svg -o test_out/ex4 –verb 3 –digits 6 -i –pages odd –svgz –noclip box .
pdf2svg -o test_out/ex5 –verb 3 –embedimages –pages 1 –svgz –box media .
;
PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] The system cannot find the file specified;
SkConvert: Command pstoedit failed: [Error 2] The system cannot find the file specified
I should also mention that reading
https://bitbucket.org/pv/textext/issue/55/textext-using-inkscape048
it seams like it is better to use 32 bit software even if having a 64 bit computer. I that true?
However, I replaced my GS View and Ghostscript with their respective 32 bit versions, but it did not make any difference to the error messages.
/Lars
Yes I also have the same problem with same error message. Somebody help….
Superb! Work just a you said. Had the same problem with inkscape 0.48 on OS X 10.6.8, installed dependencies via macports but when trying to use textext had the problem you described here. Replaced everything, restarted, and it works!
Thanks a lot, you saved my day!
please can you specify the way to add the pstoedit path to the path system variable. what did you write in the path system variable
thanks in advance
I have done the same. But I get the error message:
Traceback (most recent call last):
File “textext.py”, line 937, in
e.affect()
File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect
self.effect()
File “textext.py”, line 349, in effect
% ‘;\n’.join(converter_errors))
RuntimeError: No Latex -> SVG converter available:
Pdf2Svg: Command pdf2svg failed: [Error 2] The system cannot find the file specified;
PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] The system cannot find the file specified;
SkConvert: Command pstoedit failed: [Error 2] The system cannot find the file specified
Waiting for your reply…. Plz Plz help……
Hello, dear human being looking at your computer.
I come to you as a last resort.
It’s been two days that I’ve been trying to install Textext 0.4.4 for Inkscape 0.48 (under Windows XP, using Miktek 2.9)
I followed
– these instructions https://laconsigna.wordpress.com/2010/11/13/fixing-textext-on-inkscape-0-48/
– and these instructions http://en.wikiversity.org/wiki/User:Egm6341.s10.team3.heejun/Inkscape#Install_Textext
– and these instructions http://people.orie.cornell.edu/jmd388/design/guides/textext.pdf
– and I’ve looked through this board https://bitbucket.org/pv/textext/issues
But I keep having the same error message when I try to write something in Textext:
Traceback (most recent call last):
File “textext.py”, line 211, in cb_ok
self.callback(self.text, self.preamble_file, self.scale_factor)
File “textext.py”, line 370, in
converter_cls, old_node))
File “textext.py”, line 388, in do_convert
new_node = converter.convert(text, preamble_file, scale_factor)
File “textext.py”, line 752, in convert
self.pdf_to_svg()
File “textext.py”, line 766, in pdf_to_svg
raise NotImplementedError
NotImplementedError
Please, help me…
I can’t download the missing python packages. Can you tell which ones to look for? Otherwise it’s very complicated to carry on. Thanks
I know this is two years old, but in case anyone else is still facing problems downloading the packages: I wasn’t able to access the website with Firefox due to certificate issues, but using InternetExplorer did the trick!
Thanks for the solution. However, I got the same program as somebody else, which gave
File “textext.py”, line 307, in
raise RuntimeError(“Neither pygtk nor Tkinter is available!”)
RuntimeError: Neither pygtk nor Tkinter is available!
I have already copied everything downloaded into the Inkscape\python\Lib\site-packages, but still have problem. I am using inkscape 0.48
Thank so much for the solution, adin and asmwarrior. This was driving me absolutely nuts!
– Note for everyone else, I did nearly exactly as asmwarrior suggested, but for two adjustments.
1. pstoedit version was 3.60
2. I only made the first of the two edits to textext.py, as suggested by adin above.
Cheers,
D
PS – my firewall alerts me to a possible security issue with the python downloads package. I bypassed the warnings…so far no computer malfunction…
Same error as wookpm,
Followed the instructions but I have the error:
” File “textext.py”, line 307, in
raise RuntimeError(“Neither pygtk nor Tkinter is available!”)
RuntimeError: Neither pygtk nor Tkinter is available!”
Hi I am having the same problem as desperate person please help!!!
thanks
I had the same problem. For me it was solved by adding the direction to the pstoedit folder in the system variable path and then reinstalling the textext software. You might also wanna have a look here:
http://en.wikiversity.org/wiki/User:Egm6341.s10.team3.heejun/Inkscape#Install_Textext
It seems this error is quite frequent:
Traceback (most recent call last):
File “textext.py”, line 937, in
e.affect()
File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 215, in affect
self.effect()
File “textext.py”, line 349, in effect
% ‘;\n’.join(converter_errors))
RuntimeError: No Latex -> SVG converter available:
Pdf2Svg: Command pdf2svg failed: [Error 2] Impossibile trovare il file specificato;
PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] Impossibile trovare il file specificato;
SkConvert: Command pstoedit failed: [Error 2] Impossibile trovare il file specificato
Is there anyone that solved it?
Thanks
SOLVED: http://people.orie.cornell.edu/jmd388/design/guides/textext.pdf
Follow this guide!
I am experiencing a weird problem. I have implemnted the changes to textext.py as devised above. I have had the file opened afterwards three times to check that i actually saved it the right place under
C:\Program Files (x86)\Inkscape\share\extensions
Yet, when I try to use the extension, I get this deprecation warning
textext.py:55: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import os, sys, tempfile, traceback, glob, re, md5, copy
But my textext.py file looks like this on l 55-56
import os, sys, tempfile, traceback, glob, re, copy
import hashlib
Not the same as reported by the script?!?
Besides that i get no error messages now (I replaced the 64 bit pstoedit with the 32 bit version, as the first gave a run time error), I do not get anything rendered in LaTeX either.
How can inkscape think it is working on a different .py file. I came to think of precompiled .pyd files but could not find any in the same folder. I did find a texttex.idx file (?), and tried renaming that to _textetx.idx just to see if that changed anything. But it didn’t.
Please help.
Correction to the above post. It actually works (I just did not notice as the LaTeX rendered objects were stuck in a corner far away from the area on the drawing where i had zoomed in). I just get the weird and annoying deprecation error now every time i use the extension despite the fact that I do not appear to use md5 any longer in the script as explained above.
This has solved my problem. Thanks!!!
Thank you very much! It worked perfectly! Regards, Matthias
Thanks it worked in OS X 10.8.2 with inkscape 0.48. I, however, didn’t have to download any additional packages as these come included in the OS. I just modified the code.
Thank you for this solution! Now I can combine the power of Inkscape, LaTeX and KnotPlot (a truly wonderful application) to draw beautiful figures for my thesis! 🙂
See also: http://www.inkscapeforum.com/viewtopic.php?f=5&t=4937
THANK YOU SO MUCH! Works on my system : Windows 8 64-bit.
Thanks a lot! It works!!! You saved my day!
Hi!
I followed the instructions as you described and managed the problems. However, still when I click the TexText in the menu of extensions, there comes the window that says “Inkscape has received additional data from the script executed. The script did not return an error, but this may indicate the results will not be as expected.” However it does not show any specific error below. What could be the problem?
thanks a lot
Hi, did you find a solution for that??
I followed the instructions as well and it worked just one time, since then i have the same problem.
thanks
i’ve follwed your advise and got to the point where I try and add LaTeX code, but I then get the following pop-up box:
Error occured while converting from Latex to SVG:
Traceback (most recent call last):
File “textext.py”, line 211, in cb_ok
self.callback(self.text, self.preamble_file, self.scale_factor)
File “textext.py”, line 370, in
converter_cls, old_node))
File “textext.py”, line 388, in do_convert
new_node = converter.convert(text, preamble_file, scale_factor)
File “textext.py”, line 756, in convert
new_node = self.svg_to_group()
File “textext.py”, line 778, in svg_to_group
tree = etree.parse(self.tmp(‘svg’))
File “lxml.etree.pyx”, line 2692, in lxml.etree.parse (src/lxml/lxml.etree.c:49594)
File “parser.pxi”, line 1500, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:71364)
File “parser.pxi”, line 1529, in lxml.etree._parseDocumentFromURL (src/lxml/lxml.etree.c:71647)
File “parser.pxi”, line 1429, in lxml.etree._parseDocFromFile (src/lxml/lxml.etree.c:70742)
File “parser.pxi”, line 975, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:67740)
File “parser.pxi”, line 539, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:63824)
File “parser.pxi”, line 625, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:64745)
File “parser.pxi”, line 565, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:64088)
XMLSyntaxError: Document is empty, line 1, column 1
Does anyone know how I can correct this problem (bearing in mind that I am a complete novice with these kinds of things, so you will need to keep things very simple!)
It worked, kind of, thanks a lot.
I finally got it to work, though it wasn’t easy. After I had followed all the steps, it still wouldn’t work and I couldn’t figure out why. My problem? I simply forgot to encapsulate the LaTeX code within $$.
I got File “textext.py”, line 307, in
raise RuntimeError(“Neither pygtk nor Tkinter is available!”)
RuntimeError: Neither pygtk nor Tkinter is available!
So I restarted Inkscape twice and it work it perfectly!
Hi,
I downloaded the latest version of python and the textext and I followed the suggestions and I got the following error:
Traceback (most recent call last):
File “textext.py”, line 937, in
e.affect()
File “/usr/share/inkscape/extensions/inkex.py”, line 215, in affect
self.effect()
File “textext.py”, line 349, in effect
% ‘;\n’.join(converter_errors))
RuntimeError: No Latex -> SVG converter available:
Pdf2Svg: Command pdf2svg failed: [Errno 2] No such file or directory;
PstoeditPlotSvg: Command pstoedit -help failed: [Errno 2] No such file or directory;
SkConvert: Command pstoedit failed: [Errno 2] No such file or directory
It is blogg posts such as this that makes the scientific community go around. I humbly thank you for your effort!
Cheers from sweden!
Thank you sir! it woks like a charm!…
Great stuff! Thanks for that.
Installing was an awesome experience. Think I had every error you described here, too. Never thought, it would work in the end. But thanks to you guys I also found the solutions here. And as Derek, I forgot $..$,too. So thanks a lot to you all and don’t give up installing 😉
It is undoubtedly a keyword tool that take your business to another level. You is going to be surprised that lots of people don’t understand that they can track their pay per click marketing results so they did not track at all. Google, rolling around in its efforts to create searches easier and faster has come up while using plus1buton.
It’s remarkable for me to have a web site, which is helpful for
my experience. thanks admin
Thank you for your really helpful blog and the posts. Here, I found all the information I need to solve the problem. Now, the “TexText”-extension work smoothly.
A tribute to all of you.
Hello, I intend to textext file, but the file is protected and can not save the modified content. How to do about that?
intend to modify textext file, sorry for the mistype..
Seems like this solution doesn’t work anymore for Inkscape 0.91 for Windows. It keeps raising the pygtk not found error, even though I have pygtk in the library. Anyone having the same problem?
I can confitm it also. I’ve installed all programs (gs, gv, imagemagic, etc.) and additional pygtk sruff from the post above and fixed all strings in the script, but it doesn’t work complaining about unavailable Tkinter or Pygtk package. It seems that Python in 0.91 can’t import or load it.
I have same issue on Inkscape 0.91, Windows 7 x64 and looking for solution to run textext, any solution?
Hey Thanks for the fix.
Working with 0.48 but does not with 0.91 😥
Does anyone know fix for 0.91?
@vovo You should try textext 0.5, see here: https://en.wikiversity.org/wiki/User:Egm6341.s10.team3.heejun/Inkscape
Hi,
I’ve been following the steps (great btw, thanks a lot), but now I am facing an issue that I couldn’t find anywhere on the comments :
Everything works perectly fine, I just cannot write anything in the box whic appears. Any idea ?
I didn’t read all the comments but I still hadan issue after did all as stated in the first post.
Error code as follows:
Traceback (most recent call last):
File “textext.py”, line 937, in
e.affect()
File “C:\Program Files (x86)\Inkscape\share\extensions\inkex.py”, line 268, in affect
self.effect()
File “textext.py”, line 349, in effect
% ‘;\n’.join(converter_errors))
RuntimeError: No Latex -> SVG converter available:
Pdf2Svg: Command pdf2svg failed (code -2): Usage: pdf2svg []
;
PstoeditPlotSvg: Command pstoedit -help failed: [Error 2] The system cannot find the file specified;
SkConvert: Command pstoedit failed: [Error 2] The system cannot find the file specified
(I use pdf2svg)
The fix is following: to change in textext.py 926 line ‘254’ to ‘-2’ as follows:
def available(cls):
“””Check whether pdf2svg is available, raise RuntimeError if not”””
exec_command([‘pdf2svg’], ok_return_value=-2)
available = classmethod(available)
I still have an error:
Traceback (most recent call last):
File “textext.py”, line 211, in cb_ok
self.callback(self.text, self.preamble_file, self.scale_factor)
File “textext.py”, line 370, in
converter_cls, old_node))
File “textext.py”, line 390, in do_convert
converter.finish()
File “textext.py”, line 680, in finish
self.remove_temp_files()
File “textext.py”, line 737, in remove_temp_files
self.try_remove(self.tmp_path)
File “textext.py”, line 744, in try_remove
os.rmdir(filename)
WindowsError: [Error 145] The directory is not empty: ‘c:\\users\\jambulat\\appdata\\local\\temp\\tmp3lrb00’
Inkscape version 0.91 32bit
Now works. The last problem was in
tempfile.mkdtemp()
because my user directory name contains ‘.’, this rerurned wrong path. So I had to do the change:
self.tmp_path = ‘C:\Users\Jam.bulat\AppData\Local\Temp’ #tempfile.mkdtemp()
self.tmp_base = ”.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(8)) #’tmp’
and
changed
def remove_temp_files(self):
“””Remove temporary files”””
base = os.path.join(self.tmp_path, self.tmp_base)
for filename in glob.glob(base + ‘*’):
self.try_remove(filename)
self.try_remove(base)
self.try_remove(base) instead of self.try_remove(self.tmp_path)
Good Luck to All!
Thanks a lot for this useful description and the work figuring it out!
Hi!, i have this problem as soon as i try to use the Tex Text extension and i don’t know what to do. This occurs after i replaced the lines in the textext.py file.
textext.py:55: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import os, sys, tempfile, traceback, glob, re, md5, copy
Traceback (most recent call last):
File “textext.py”, line 306, in
raise RuntimeError(“Neither pygtk nor Tkinter is available!”)
RuntimeError: Neither pygtk nor Tkinter is available!
For Inkscape 0.92, I applied the fix above and I kept having the tkinter missing issue. To solve it I installed on my computer python 2.7.13 (64-bits installer https://www.python.org/downloads/release/python-2713/) in a folder named ‘python’, and then copied-pasted the newly installed ‘python’ folder to replace the one inside the folder where Inkscape is installed. Now it works.
I tried doing this with Inkscape 0.92 x86, after having the same problem, but it didn’t work. Was it Inkscape 64bits version you installed?