{"id":215,"date":"2008-06-24T06:57:21","date_gmt":"2008-06-24T06:57:21","guid":{"rendered":"http:\/\/www.sasamat.ca\/test\/?p=215"},"modified":"2014-02-10T00:05:02","modified_gmt":"2014-02-10T00:05:02","slug":"cached-eggs","status":"publish","type":"post","link":"https:\/\/www.timwyatt.ca\/test\/?p=215","title":{"rendered":"cached eggs"},"content":{"rendered":"<p>I Ran into a snafu when installing the mysql_python egg from pypi. I believe this issue relates to any egg that remains packed after install.<\/p>\n<p>What happens is that a cache directory is created under the user that runs the install. Typically root, or some other privileged user that can write to Python&#8217;s site-packages dir. This cache dir, is thus inaccessible to the web server&#8217;s unprivileged account: consequently code running under mod_python, for example, cannot\u00a0 access the cache dir and hence the library.<\/p>\n<p>One option is to create a system wide env variable, PYTHON_EGG_CACHE, and point it to some accessible directory. I believe easy_install respects this and will use it to create the cache location for the library or app that is being downloaded.<\/p>\n<p>I found an easier solution. Use easy_install with the forced unpacking option to write the unpacked library into site-packages. This means the code is visible to all Python users without the need of cache directories or env. variables. (easy_install -Z yourpackage).<\/p>\n<p>If you need to delete existing eggs so you can retry the install as suggested, then you need to remove the offending egg from site-packags and also from the .pth file containing a reference to it&#8211;also in site-packages.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I Ran into a snafu when installing the mysql_python egg from pypi. I believe this issue relates to any egg that remains packed after install. What happens is that a cache directory is created under&hellip;<\/p>\n<p><a class=\"readmore\" href=\"https:\/\/www.timwyatt.ca\/test\/?p=215\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-215","post","type-post","status-publish","format-standard","hentry","category-uncategorized","comments-off"],"_links":{"self":[{"href":"https:\/\/www.timwyatt.ca\/test\/index.php?rest_route=\/wp\/v2\/posts\/215"}],"collection":[{"href":"https:\/\/www.timwyatt.ca\/test\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.timwyatt.ca\/test\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.timwyatt.ca\/test\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.timwyatt.ca\/test\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=215"}],"version-history":[{"count":1,"href":"https:\/\/www.timwyatt.ca\/test\/index.php?rest_route=\/wp\/v2\/posts\/215\/revisions"}],"predecessor-version":[{"id":216,"href":"https:\/\/www.timwyatt.ca\/test\/index.php?rest_route=\/wp\/v2\/posts\/215\/revisions\/216"}],"wp:attachment":[{"href":"https:\/\/www.timwyatt.ca\/test\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.timwyatt.ca\/test\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.timwyatt.ca\/test\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}