<?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>HCoder.org &#187; easy_install</title>
	<atom:link href="http://hcoder.org/tag/easy_install/feed/" rel="self" type="application/rss+xml" />
	<link>http://hcoder.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 15 Apr 2012 21:43:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Frustrated by Python module management</title>
		<link>http://hcoder.org/2008/06/24/frustrated-by-python-module-management/</link>
		<comments>http://hcoder.org/2008/06/24/frustrated-by-python-module-management/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 20:28:00 +0000</pubDate>
		<dc:creator>emanchado</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[easy_install]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[setuptools]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I don&#8217;t really do any Python development myself, but at work I do support some automated testing infrastructure (in this particular case, I&#8217;m talking about a CruiseControl.rb installation), and some of the projects that use that infrastructure use Python. The setup is so that the tests are actually executed in the CC.rb server, so I [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t really do any Python development myself, but at work I do support some automated testing infrastructure (in this particular case, I&#8217;m talking about a <a href="http://cruisecontrolrb.thoughtworks.com/">CruiseControl.rb</a> installation), and some of the projects that use that infrastructure use Python. The setup is so that the tests are actually executed in the CC.rb server, so I have to have Python installed there, and it has to have some basic dependencies to be able to run the tests.</p>
<p>A couple of times something strange happened: suddenly, those tests would start failing with no apparent reason, and looking at the logs, it looked like some dependencies were not installed (error messages such as <code>ImportError: No module named sqlalchemy</code>). Of course that didn&#8217;t make any sense, because SQLAlchemy is needed for the tests and they were working like a charm for weeks. I was totally and completely confused by the error message, and I tried to install SQLAlchemy again. That solved the problem, luckily, so I decided to forget about it because it wasn&#8217;t my thing anyway.</p>
<p>But the problems appeared again. And again. And I got another error message that was really confusing, because it looked like Python was using some old version of some module (a version that wasn&#8217;t there anymore, because the code had been updated from <span class="caps">SVN</span>). So I just got tired of not knowing what was going on, and decided to investigate enough to find out the root of the problem. And I found something surprising.</p>
<p>What I found is that the famous <code>python setup.py develop</code> (that everyone told me to use) actually adds the &#8220;current directory&#8221; to the list of paths where Python searches for modules, so you can develop your module and use it from anywhere. I had heard some comment on that, but I didn&#8217;t quite get what it meant, and I don&#8217;t think the person that said it realised either.</p>
<p>The fun thing with <code>setup.py develop</code> is that when you have several <strong>branches</strong> of the same project in the same machine, and you use that to make the modules available&#8230; well, I guess that knowing which versions of which modules Python will use becomes an <em>interesting</em> question to say the least. I&#8217;m not saying that the way it works is necessarily wrong, but I do think it is dangerous, and people shouldn&#8217;t think of it as the &#8220;normal&#8221; way of developing modules in Python. It should be used with care.</p>
<p>After having realised that and thought about it a bit, I still don&#8217;t understand why those modules simply &#8220;dissappeared&#8221;, but it seems that there was some corruption of <code>/usr/lib/python2.5/site-packages/easy_install.pth</code> or similar (that file seems to be modified when you install packages with <code>easy_install</code>, <strong>and</strong> it had references to the directories I ran <code>setup.py develop</code> from, so that&#8217;s my main suspect for now). At least I know now that I could backup a working <code>easy_install.pth</code> file, and restore when we have problems again, but I&#8217;m far from happy with that &#8220;solution&#8221; <code>;-)</code></p>
<p>Also, I&#8217;m wondering what the hell should I do in the future to prevent more problems, because using <code>setup.py develop</code> sounds like a terrible idea to me. I tried to set <code>PYTHONPATH</code> instead, but apparently I failed. Any suggestions?</p>
<p><strong><span class="caps">EDIT</span>:</strong> I&#8217;m finally using <code>PYTHONPATH</code>. I have no idea what I tried last time, but using it was easy, quick and clean. I still have no idea why the hell Python sometimes forgets where some modules are, though.</p>
 <p><a href="http://hcoder.org/?flattrss_redirect&amp;id=30&amp;md5=566e30e2dcb27738522dec71b1edbde0" title="Flattr" target="_blank"><img src="http://hcoder.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://hcoder.org/2008/06/24/frustrated-by-python-module-management/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=30124&amp;popout=1&amp;url=http%3A%2F%2Fhcoder.org%2F2008%2F06%2F24%2Ffrustrated-by-python-module-management%2F&amp;language=en_GB&amp;category=text&amp;title=Frustrated+by+Python+module+management&amp;description=I+don%26%238217%3Bt+really+do+any+Python+development+myself%2C+but+at+work+I+do+support+some+automated+testing+infrastructure+%28in+this+particular+case%2C+I%26%238217%3Bm+talking+about+a+CruiseControl.rb+installation%29%2C+and+some...&amp;tags=easy_install%2Cmodules%2Cpackages%2Cpython%2Csetuptools%2Cblog" type="text/html" />
	</item>
	</channel>
</rss>

