{"id":1013,"date":"2019-08-16T16:25:47","date_gmt":"2019-08-16T22:25:47","guid":{"rendered":"https:\/\/wmbuck.net\/blog\/?p=1013"},"modified":"2019-08-16T16:30:32","modified_gmt":"2019-08-16T22:30:32","slug":"python-hack","status":"publish","type":"post","link":"https:\/\/wmbuck.net\/blog\/?p=1013","title":{"rendered":"Python Hack"},"content":{"rendered":"\n<p>I suddenly had a problem on the laptop (ubuntu 18.04, Bionic), and I&#8217;ve seen similar problems on Cinnamon. One manifestation is that when I try to start terminal using the gnome-terminal.desktop app, i.e. the icon in the dock, the launch fails, with no stated reason. A look in the log reveals a problem in Python loading _gi. <\/p>\n\n\n\n<p>I resolved to look at it later. I was able to start the terminal from the  desktop by right clicking, and open terminal. <\/p>\n\n\n\n<p>Later I had a similar problem trying to launch gnome-tweak. It failed in the same way, trying to start up the python app it attempted to load _gi. <\/p>\n\n\n\n<p>I have only the vaguest clue what is going on here. I looked at the python code. Indeed they are attempting: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">From . import _gi. <\/pre>\n\n\n\n<p>And the directory \/usr\/lib\/python3\/dist-packages\/gi does not have a  library named _gi. It does however have two library files: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">_gi.cpython-36m-x86_64-linux-gnu.so\n   and \n_gi_cairo.cpython-36m-x86_64-linux-gnu.so<\/pre>\n\n\n\n<p>Perusing the net, I find some suggestion that these libraries, with the 36m designation are somehow specific to or found by Python 3.6, and that if I want this to work under Python 3.7, I have to copy these files, and change 36m to 37m. <\/p>\n\n\n\n<p>Ok, what have I got to lose? I did that simple thing &#8211; with just a simple copy in the above named directory. Lo and behold, it fixed the symptom that I was experiencing.  <\/p>\n\n\n\n<p>I don&#8217;t really like fixing things with magic when I don&#8217;t know what is happening, but now is not the time to go on a voyage of discovery with Python. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I suddenly had a problem on the laptop (ubuntu 18.04, Bionic), and I&#8217;ve seen similar problems on Cinnamon. One manifestation is that when I try to start terminal using the gnome-terminal.desktop app, i.e. the icon in the dock, the launch fails, with no stated reason. A look in the log reveals a problem in Python &hellip; <a href=\"https:\/\/wmbuck.net\/blog\/?p=1013\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Python Hack<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,43,9],"tags":[],"class_list":["post-1013","post","type-post","status-publish","format-standard","hentry","category-linux","category-python","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1013"}],"collection":[{"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1013"}],"version-history":[{"count":2,"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1013\/revisions"}],"predecessor-version":[{"id":1015,"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1013\/revisions\/1015"}],"wp:attachment":[{"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1013"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1013"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wmbuck.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1013"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}