{"id":13,"date":"2008-08-29T23:22:03","date_gmt":"2008-08-29T22:22:03","guid":{"rendered":"http:\/\/paguilar.org\/?p=13"},"modified":"2008-08-29T23:22:03","modified_gmt":"2008-08-29T22:22:03","slug":"installing-python-packages-for-enigma2","status":"publish","type":"post","link":"https:\/\/paguilar.org\/?p=13","title":{"rendered":"Installing Python packages for enigma2"},"content":{"rendered":"<p>In a <a href=\"https:\/\/paguilar.org\/?p=8\" title=\"cross-compiling enigma2 for sh4\">previous post<\/a> I described how to compile enigma2 for the sh4 arch. That procedure works as expected if you have Python 2.5 or greater. In my case I had Python 2.4 that does not contain some packages that enigma2 requires.<\/p>\n<p>In this post I describe which packages are missing and how to compile and install them.<br \/>\nAs before, my target is an STb7109 cut 3.0 board, also called cocoref MB442, that is part of the sh4 arch family.<\/p>\n<p>These are the four packages:<\/p>\n<ul>\n<li>elementtree-1.2.6-20050316<\/li>\n<li>cElementTree-1.0.5-20051216<\/li>\n<li>zope.interface-3.3.0.tar.gz<\/li>\n<li>Twisted-8.1.0.tar.bz2<\/li>\n<\/ul>\n<p>The <em>elementtree<\/em> and <em>cElementTree<\/em> packages are needed only if you have Python version &lt;2.5, whilst <em>zope.interface<\/em> and <em>Twisted<\/em> must be downloaded and installed independently of the Python version because they are not included in any Python release.<\/p>\n<p><em>elementtre<\/em> and <em>cElementTree<\/em> are used for optimizing XML parsing with low memory use. Typically, cElementTree is 15-20 times faster than the Python version of ElementTree, and uses 2-5 times less memory. Both packages can be downloaded from here: <a href=\"http:\/\/effbot.org\/zone\/celementtree.htm\" title=\"Download elementtree and cElementTree\">http:\/\/effbot.org\/zone\/celementtree.htm<br \/>\n<\/a><br \/>\n<em>zope.interface<\/em> is a web application server that publishes on the web Python objects persisted in an object database such as documents, images and page templates. It can be downloaded from here: <a href=\"http:\/\/zope.org\/Products\/ZopeInterface\" title=\"Download zope.interface\">http:\/\/zope.org\/Products\/ZopeInterface<\/a><\/p>\n<p>Twisted is an event-driven networking engine. It  can be downloaded from here: <a href=\"http:\/\/twistedmatrix.com\/trac\" title=\"Download Twisted\">http:\/\/twistedmatrix.com\/trac<\/a><\/p>\n<p><font size=\"3\"><br \/>\n<strong>Compiling and installing<\/strong><\/font><\/p>\n<p>Copy the packages to your rootfs and connect to your target. This will be a <strong>native compilation<\/strong>, not a cross-compilation as in the previous post.<br \/>\nRemember that PREFIX is the path in your host of the rootfs of your target. In my case is the following. Adjust it according to your configuration:<\/p>\n<pre lang=\"bash\">\n$ export PREFIX=\/opt\/oe\/STM\/STLinux-2.2\/devkit\/sh4\/target<\/pre>\n<p>Copy and connect to target:<\/p>\n<pre lang=\"bash\">\n$ cp elementtree-1.2.6-20050316.tar.gz $PREFIX\/home\n$ cp cElementTree-1.0.5-20051216.tar.gz $PREFIX\/home\n$ cp zope.interface-3.3.0.tar.gz $PREFIX\/home\n$ cp Twisted-8.1.0.tar.bz2 $PREFIX\/home\n$ ssh root@target<\/pre>\n<p>Untar the packages and install them:<\/p>\n<p><font size=\"2\"><br \/>\n<em>elementtree<\/em><\/font><\/p>\n<pre lang=\"bash\">\n$ cd \/home\n$ tar xvfz elementtree-1.2.6-20050316.tar.gz\n$ cd elementtree-1.2.6-20050316\n$ python setup.py install<\/pre>\n<p><font size=\"2\"><br \/>\n<em>cElementTree<\/em><\/font><\/p>\n<pre lang=\"bash\">\n$ cd ..\n$ tar xvfz cElementTree-1.0.5-20051216.tar.gz\n$ cd cElementTree-1.0.5-20051216\n$ python setup.py install<\/pre>\n<p><font size=\"2\"><br \/>\n<em>zope.interface<\/em><\/font><\/p>\n<pre lang=\"bash\">\n$ cd ..\n$ tar xvfz zope.interface-3.3.0.tar.gz\n$ cd zope.interface-3.3.0\n$ python setup.py build<\/pre>\n<p><font size=\"2\"><br \/>\n<em>Twisted<\/em><\/font><\/p>\n<pre lang=\"bash\">\n$ cd ..\n$ tar xvfj Twisted-8.1.0.tar.bz2\n$ cd Twisted-8.1.0\n$ python setup.py install<\/pre>\n<p>As you can see, it&#8217;s a very simple and standard procedure normally used for installing Python packages.<br \/>\nHowever, notice that for installing <em>cElementTree<\/em>, <em>zope.interface<\/em> and <em>Twisted<\/em>, Python will compile C source code. Since this is a native compilation in the target it will take significantly more time than in your host.<br \/>\nOnce you have these packages installed enigma2 will not give any errors regarding missing Python packages and will have all its default functionality activated.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a previous post I described how to compile enigma2 for the sh4 arch. That procedure works as expected if you have Python 2.5 or greater. In my case I had Python 2.4 that does not contain some packages that enigma2 requires. In this post I describe which packages are missing and how to compile\u2026 <span class=\"read-more\"><a href=\"https:\/\/paguilar.org\/?p=13\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,9],"tags":[52,55],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-compiling","category-enigma2","tag-compiling","tag-enigma2"],"_links":{"self":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13"}],"version-history":[{"count":0,"href":"https:\/\/paguilar.org\/index.php?rest_route=\/wp\/v2\/posts\/13\/revisions"}],"wp:attachment":[{"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/paguilar.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}