
{"id":43413,"date":"2022-12-05T08:59:47","date_gmt":"2022-12-05T08:59:47","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=43413"},"modified":"2022-12-05T08:59:47","modified_gmt":"2022-12-05T08:59:47","slug":"fix-typecatcher-ubuntu-2204","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2022\/12\/fix-typecatcher-ubuntu-2204\/","title":{"rendered":"Fix TypeCatcher (Google Fonts Installer) does not launch in Ubuntu 22.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecather-logo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-43414\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecather-logo-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecather-logo-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecather-logo-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecather-logo-600x600.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecather-logo-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecather-logo.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>This simple tutorial shows how to fix the launching issue for TypeCatcher in Ubuntu 22.04 or other Linux with Python 3.9 &amp; higher.<\/p>\n<p>TypeCatcher is a simple GTK application to download and install Google webfonts for off-line use. The app is <em>available to install in Ubuntu Software<\/em> for all current Ubuntu releases. However, <b>it does not launch in Ubuntu since 21.10.<\/b><\/p>\n<div id=\"attachment_43417\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecatcher-injammy.webp\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-43417\" class=\"size-large wp-image-43417\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecatcher-injammy-600x390.webp\" alt=\"\" width=\"600\" height=\"390\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecatcher-injammy-600x390.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecatcher-injammy-300x195.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecatcher-injammy.webp 752w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-43417\" class=\"wp-caption-text\">TypeCatcher, download &amp; install Google Fonts<\/p><\/div>\n<p>When trying to launch it from command line, it outputs something like this:<\/p>\n<blockquote><p>Traceback (most recent call last):<br \/>\nFile &#8220;\/usr\/lib\/python3\/dist-packages\/typecatcher_lib\/Application.py&#8221;, line 30, in on_activate<br \/>\nself.window = TypeCatcherWindow.TypeCatcherWindow()<br \/>\nFile &#8220;\/usr\/lib\/python3\/dist-packages\/typecatcher_lib\/Window.py&#8221;, line 47, in __new__<br \/>\nbuilder = get_builder(&#8216;TypeCatcherWindow&#8217;)<br \/>\nFile &#8220;\/usr\/lib\/python3\/dist-packages\/typecatcher_lib\/helpers.py&#8221;, line 44, in get_builder<br \/>\nbuilder.add_from_file(ui_filename)<br \/>\nFile &#8220;\/usr\/lib\/python3\/dist-packages\/typecatcher_lib\/Builder.py&#8221;, line 86, in add_from_file<br \/>\nele_widgets = tree.getiterator(&#8220;object&#8221;)<br \/>\nAttributeError: &#8216;ElementTree&#8217; object has no attribute &#8216;getiterator&#8217;<\/p><\/blockquote>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecacher-jammy.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43415\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecacher-jammy-600x407.webp\" alt=\"\" width=\"600\" height=\"407\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecacher-jammy-600x407.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecacher-jammy-300x203.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecacher-jammy-768x521.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/typecacher-jammy.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><b>The issue is because of the removal of <code>getiterator()<\/code> methods from xml.etree.ElementTree module in Python 3.9, which was deprecated since Python 3.2.<\/b><\/p>\n<p>As the <a href=\"https:\/\/docs.python.org\/3\/whatsnew\/3.9.html\" target=\"_blank\" rel=\"noopener\">announcement<\/a> indicates, simply use <code>iter()<\/code> method instead will fix the issue.<\/p>\n<blockquote><p>Methods getchildren() and getiterator() of classes ElementTree and Element in the ElementTree module have been removed. They were deprecated in Python 3.2. Use iter(x) or list(x) instead of x.getchildren() and x.iter() or list(x.iter()) instead of x.getiterator().<\/p><\/blockquote>\n<p>1. First, search for and open a terminal window from either start menu or &#8216;Activities&#8217; overview depends on your desktop environment.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/terminal-jammy.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-38555\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/terminal-jammy.png\" alt=\"\" width=\"522\" height=\"299\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/terminal-jammy.png 522w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/terminal-jammy-300x172.png 300w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><\/a><\/p>\n<p>2. When terminal opens, <strong>run command to edit the file<\/strong> that contains the &#8216;getiterator()&#8217; method (see the first screenshot). In the case, it&#8217;s &#8220;\/usr\/lib\/python3\/dist-packages\/typecatcher_lib\/Builder.py&#8221;.<\/p>\n<pre>sudo gedit \/usr\/lib\/python3\/dist-packages\/typecatcher_lib\/Builder.py<\/pre>\n<p><i>replace <b>gedit<\/b> to your favorite text editor, or use <b>nano<\/b> command line editor that works in most Linux.<\/i><\/p>\n<p>3. When files opens, <i>find out and replace <b>tree.getiterator<\/b> with <b>tree.iter<\/b><\/i>.<\/p>\n<p>For Gedit text editor, just go to menu, click open &#8216;Find and Replace&#8217; dialog. Finally, insert <b>tree.getiterator<\/b> as &#8216;Find&#8217;, and &#8216;<b>tree.iter<\/b>&#8216; as &#8216;Replace with&#8217;, then click on &#8216;Replace All&#8217; button.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/fix-typecatcher.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43416\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/fix-typecatcher-600x413.webp\" alt=\"\" width=\"600\" height=\"413\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/fix-typecatcher-600x413.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/fix-typecatcher-300x206.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/fix-typecatcher-768x528.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/12\/fix-typecatcher.webp 804w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>For nano text editor, press <b>Alt+R<\/b> when the file opens in terminal window. Then type <i>tree.getiterator<\/i> when it indicates &#8216;Search (to replace)&#8217;, hit Enter, and insert <i>tree.iter<\/i> when prompts &#8216;Replace with&#8217;. Finally, hit Enter and type y. Or, just use arrow keys to find and replace the keyword (there are 2) manually. And, press <strong>Ctrl+x<\/strong>, type <strong>y<\/strong>, and hit Enter to save changes.<\/p>\n<p>After saving the file, try to launch it either from &#8216;Activities&#8217; overview or command line, and enjoy!<\/p>","protected":false},"excerpt":{"rendered":"<p>This simple tutorial shows how to fix the launching issue for TypeCatcher in Ubuntu 22.04 or other Linux with Python 3.9 &amp; higher. TypeCatcher is a simple GTK application to download and install Google webfonts for off-line use. The app is available to install in Ubuntu Software for all current Ubuntu releases. However, it does [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":43414,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1345],"class_list":["post-43413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-font"],"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/43413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=43413"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/43413\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/43414"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=43413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=43413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=43413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}