<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mFabrik - mobile sites, apps, HTML5 and CMS software development &#187; virtualenv</title>
	<atom:link href="http://blog.mfabrik.com/tag/virtualenv/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mfabrik.com</link>
	<description>Freedom delivered.</description>
	<lastBuildDate>Wed, 03 Aug 2011 09:47:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Easily install all Python versions under Linux and OSX using collective.buildout.python</title>
		<link>http://blog.mfabrik.com/2010/07/16/easily-install-all-python-versions-under-linux-and-osx-using-collective-buildout-python/</link>
		<comments>http://blog.mfabrik.com/2010/07/16/easily-install-all-python-versions-under-linux-and-osx-using-collective-buildout-python/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 07:47:45 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[plone]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[buildout]]></category>
		<category><![CDATA[collective]]></category>
		<category><![CDATA[compilation]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[pil]]></category>
		<category><![CDATA[python imaging library]]></category>
		<category><![CDATA[readline]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=576</guid>
		<description><![CDATA[Here are short instructions how to install all versions (2.4, 2.5, 2.6, 2.7 and 3.1) of Python interpreters on UNIX system. The instructions were tested on Ubuntu 10.04 Lucid Lynx Linux but should work on other systems as is. The installation is based of downloading, compiling and installing different Pythons and their libraries using buildout [...]]]></description>
			<content:encoded><![CDATA[<p>Here are short instructions how to install all versions (2.4, 2.5, 2.6, 2.7 and 3.1) of Python interpreters on UNIX system. The instructions were tested on Ubuntu 10.04 Lucid Lynx Linux but should work on other systems as is. The installation is based of downloading, compiling and installing different Pythons and their libraries using <a href="http://www.buildout.org">buildout </a>tool. <a href="http://svn.plone.org/svn/collective/buildout/python/">A buildout configuration for doing this</a> is maintained by a <a href="http://plone.org">Plone</a> community.</p>
<p>This buildout is especially useful to get Python 2.4 properly running under the latest Ubuntu 10.04 Lucid Lynx. This is because Ubuntu repositories won&#8217;t ship with Python 2.4 packages anymore.</p>
<p>The installation will also include static compilation of some very popular libraries. These are dependencies for other Python packages including, but not limited, to</p>
<ul>
<li>libjpeg</li>
<li>Python imaging library</li>
<li>readline</li>
</ul>
<h2>Prerequisites</h2>
<ul>
<li>Some Python version is installed (OS default)</li>
<li>GCC compiler is installed (sudo apt-get install build-essential)</li>
<li>Subversion tool is installed (sudo apt-get install subversion)</li>
</ul>
<h2>Running it</h2>
<pre>svn co http://svn.plone.org/svn/collective/buildout/python/
cd python
python bootstrap.py
bin/buildout</pre>
<h2>Using it</h2>
<p>All Pythons are under <a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a> installations. This means that you can activate one Python configuration for your shell once easily (<em>python</em> command will run under different Python versions).</p>
<p>Activating Python 2.4</p>
<pre>source python/python-2.4/bin/activate
(python-2.4)moo@murskaamo:~/code$ python -V
Python 2.4.6</pre>
<p>Check that Python Imaging Library works</p>
<pre>python
Python 2.4.6 (#1, Jul 16 2010, 10:31:46)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import PIL</pre>
<p>(No exceptions raised, Python Imaging Library works well).
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2010/07/16/easily-install-all-python-versions-under-linux-and-osx-using-collective-buildout-python/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Installing Python Imaging Library (PIL) under virtualenv or buildout</title>
		<link>http://blog.mfabrik.com/2009/11/19/installing-python-imaging-library-pil-under-virtualenv-or-buildout/</link>
		<comments>http://blog.mfabrik.com/2009/11/19/installing-python-imaging-library-pil-under-virtualenv-or-buildout/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 20:58:16 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[plone]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[buildout]]></category>
		<category><![CDATA[pil]]></category>
		<category><![CDATA[satchmo]]></category>
		<category><![CDATA[site packages]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://blog.twinapex.fi/?p=349</guid>
		<description><![CDATA[I have greatly struggled to have PIL library support in isolated Python environments like virtualenv &#8211;no-site-packages. For example, when installing Satchmo shop under virtualenv: ../bin/clonesatchmo.pyhe Python Imaging Library is not installed. Install from your distribution binaries. ../bin/clonesatchmo.py The Python Imaging Library is not installed. Install from your distribution binaries. Though it clearly is there, installed [...]]]></description>
			<content:encoded><![CDATA[<p>I have greatly struggled to have PIL library support in isolated Python environments like virtualenv &#8211;no-site-packages.</p>
<p>For example, when installing <a href="http://www.satchmoproject.com/">Satchmo</a> shop under virtualenv:</p>
<pre>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">../bin/clonesatchmo.pyhe Python Imaging Library is not installed. Install from your distribution binaries.</div>

../bin/clonesatchmo.py
The Python Imaging Library is not installed. Install from your distribution binaries.</pre>
<p>Though it clearly is there, installed by <em>easy_install PIL </em>command:</p>
<pre>ls ../lib/python2.5/site-packages/PIL-1.1.7-py2.5-linux-x86_64.egg
ArgImagePlugin.py	 ExifTags.py		  GimpGradientFile.pyc...</pre>
<p>Does anyone know if this problem is with PIL itself, eggified PIL or something else?</p>
<p>In any case, there is an easy workaround: use system-wide PIL (sudo apt-get install python-imaging) and symlink PIL from your site-wide installation under the isolated Python environment:</p>
<pre>(satchmo-py25)mulli% pwd
/srv/plone/mmaspecial/satchmo-py25/lib/python2.5/site-packages
(satchmo-py25)mulli% ln -s /usr/lib/python2.4/PIL .</pre>
<div>That works for now, but I&#8217;d like to learn how to make virtualenv and buildout install PIL egg bullet-proof way.</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2009/11/19/installing-python-imaging-library-pil-under-virtualenv-or-buildout/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Packing and copying Data.fs from production server for local development</title>
		<link>http://blog.mfabrik.com/2009/09/01/packing-and-copying-data-fs-from-production-server-for-local-development/</link>
		<comments>http://blog.mfabrik.com/2009/09/01/packing-and-copying-data-fs-from-production-server-for-local-development/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 11:30:56 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[plone]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[packing]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[synchronize]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtualenv]]></category>
		<category><![CDATA[zodb]]></category>

		<guid isPermaLink="false">http://blog.twinapex.fi/?p=267</guid>
		<description><![CDATA[These instructions help you to copy and transfer production server  ZODB database (Data.fs) to your local computer for development and testing. This allows you to do the testing against the copy of real data and the production server Plone instance set up. See the original tip by cguardia. Data.fs is ZODB file storage for transactional [...]]]></description>
			<content:encoded><![CDATA[<p>These instructions help you to copy and transfer production server  ZODB database (Data.fs) to your local computer for development and testing. This allows you to do the testing against the copy of real data and the production server Plone instance set up.</p>
<p><a href="http://blog.delaguardia.com.mx/packing-the-zodb-offline">See the original tip by cguardia</a>.</p>
<p>Data.fs is ZODB file storage for transactional database. Journal history takes quite a lot of disk space there. Packing, i.e. removing the journal history,  usually reduces the size file considerably, making the file lighter for wire transfer. Depending on the database age the packed copy is less than 10% of the original size.</p>
<p>These instructions apply for Ubuntu/Debian based Linux systems. Apply to your own system using the operating system best practices.</p>
<p>We need ZODB Python package to work with the database. To use it, we&#8217;ll create virtualenv Python installation in /tmp. In virtualenv installation, installed Python packages do not pollute or break the system wide setup. Note that you might use easy-install-2.4 depending on the OS. <a href="http://pypi.python.org/pypi/ZODB3">The latest stable ZODB can be picked from PyPi listing</a>. Plone 3.x default is ZODB 3.7.x, which is not available as Python egg, but you can use ZODB 3.8.x.</p>
<pre>
<pre>sudo easy-install virtualenv</pre>
<p>cd /tmp</p>
<p>virtualenv packer</p>
<p>/tmp/packer/bin/easy_install ZODB=3.8.3</pre>
<p>Data.fs cannot be modified in-place. You must create a copy of it to work with it. Data.fs copy can be created from a running system without the fear of corrupting the database, since ZODB is append only database.</p>
<pre>cp /yoursite/var/filestorage/Data.fs /tmp/Data.fs.copy</pre>
<p>Then create the following script snippet <em>/tmp/pack.py</em> using your favorite terminal editor.</p>
<pre>import time
import ZODB.FileStorage
import ZODB.serialize

storage=ZODB.FileStorage.FileStorage('/tmp/Data.fs.copy')
storage.pack(time.time(),ZODB.serialize.referencesf)</pre>
<p>And run it using virtualenv&#8217;ed Python setup with ZODB installed:</p>
<pre>/tmp/packer/bin/python /tmp/pack.py</pre>
<p>Lots of patience here&#8230; packing may take a while, but it&#8217;s still definitely faster than your Internet connection transfer rate.</p>
<p>Verify that the file is succesfully packed:</p>
<pre>ls -lh Data.fs.copy
-rw-r--r-- 1 user user 30M 2009-09-01 13:24 Data.fs.copy</pre>
<p>Woohoo 1 GB was shrunk to 30 MB. Then copy the file to your local computer using scp and place it to your development buildout.</p>
<pre>scp user@server:/tmp/Data.fs.copy ~/mybuildout/var/filestorage/Data.fs</pre>
<p>You just saved about 30-90 minutes of waiting of file transfer.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2009/09/01/packing-and-copying-data-fs-from-production-server-for-local-development/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Python code management &amp; deployment &#8211; a glance at zc.buildout and few others</title>
		<link>http://blog.mfabrik.com/2008/09/02/python-code-management-deployment-a-glance-at-zcbuildout-and-few-others/</link>
		<comments>http://blog.mfabrik.com/2008/09/02/python-code-management-deployment-a-glance-at-zcbuildout-and-few-others/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 08:24:47 +0000</pubDate>
		<dc:creator>Tuukka Mustonen</dc:creator>
				<category><![CDATA[development tools]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[zope]]></category>
		<category><![CDATA[buildout]]></category>
		<category><![CDATA[code management]]></category>
		<category><![CDATA[paver]]></category>
		<category><![CDATA[virtualenv]]></category>
		<category><![CDATA[zc.buildout]]></category>

		<guid isPermaLink="false">http://blog.redinnovation.com/?p=104</guid>
		<description><![CDATA[We&#8217;ve been using zc.buildout for Plone deployment and it&#8217;s working out great. A few days ago implemented a buildout recipe for Django project deployment, automatic web configuration, symlinking, media-folder structuring etc. and while I got it working, I came up with twisted feelings. Buildout is from the creators of Zope (I suppose) so you can [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been using <a href="http://pypi.python.org/pypi/zc.buildout/1.1.1">zc.buildout</a> for <a href="http://www.plone.org">Plone</a> deployment and it&#8217;s working out great. A few days ago implemented a buildout recipe for <a href="http://www.djangoproject.org">Django</a> project deployment, automatic web configuration, symlinking, media-folder structuring etc. and while I got it working, I came up with twisted feelings.</p>
<p>Buildout is from the creators of <a href="http://www.zope.org/">Zope</a> (I suppose) so you can expect a powerful project code management tool. The question is, however, whether or not it suits your needs. In my case I found out it too heavy. I mean, to add even a simple task you have to create a new &#8220;recipe&#8221; (a package) that does the tricks. Of course some recipes are generic (found from <a href="http://pypi.python.org">PyPi</a>) and you can just run them with your own INI options, but in my case I had to do some custom implementation. Creating a new python package isn&#8217;t that hard for sure <img src='http://blog.mfabrik.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  but there&#8217;s of course some learning curve, so the <em>real</em> question is should you spend time to learn it or not?</p>
<p>I found out that zc.buildout has some nice features like:</p>
<ul>
<li> Automatic requirements processing through setuptools</li>
<li>Automatic (yet simple) removal of directories during recipe uninstall</li>
<li>Clear structure (install(), update() &amp; uninstall() methods)</li>
<li>INI-syntax, python does have a clear syntax but INI is always clearer for a newbie</li>
<li>Easy script creation (adjust python paths somewhat automatically)</li>
<li>Easily repeatable</li>
<li>Passing of arguments from one recipe to another</li>
<li>etc.</li>
</ul>
<p>The problems?</p>
<ul>
<li>It takes a while to learn zc.buildout</li>
<li>It takes &#8216;another while&#8217; to learn to write recipes</li>
<li>Too much hassle for little things</li>
<li>INI-syntax is very limited in features</li>
<li>Buildout easily updates all your packages (that means also the ones you didn&#8217;t want to!)</li>
<li>Lack of documentation (it has good docs to get you going.. but after a while it leaves you with open questions)</li>
<li>Unnecessary overhead (for each script you launch, you&#8217;ll need a launcher script created via buildout)</li>
</ul>
<p>There&#8217;s no denying zc.buildout is powerful, but I wouldn&#8217;t use it for projects which need reasonable amount of customization. It&#8217;s just plain easier and quicker to write shell scripts and while those won&#8217;t provide you with any sort of ready tools you won&#8217;t propably need them. For bringing up somewhat static environment, where you don&#8217;t need to hack things (like that for Plone) it&#8217;s quite a decent option, however.</p>
<p>I also explored alternatives to zc.buildout. I&#8217;ve been reading about earlier virtualenv but haven&#8217;t really tried it out until now. It looks very promising and creates a more flexible environment compared to zc.buildout. Of course their goals are not exactly the same. Also, there are a few other alternatives out there, among them a new Python code management tool called <a href="http://www.blueskyonmars.com/projects/paver/">Paver</a> (just look at that cool logo.. it does remind you of Indiana Jones, does it not?). I glanced through the Paver docs and it looks like it <em>might</em> be the way to go (Paver also supports virtualenv), but didn&#8217;t quite get the grasp of the benefits just yet. Anyway, if you are still interested in code management and deployment, I&#8217;d recommend you to read the <a href="http://www.blueskyonmars.com/2008/04/22/paver-and-the-building-distribution-deployment-etc-of-python-projects/">Paver release announcement</a> and also <a href="http://www.blueskyonmars.com/projects/paver/foreword.html">Paver forewords</a>. They should clear things up.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2008/09/02/python-code-management-deployment-a-glance-at-zcbuildout-and-few-others/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

