<?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>Christopher Lawlor &#187; virtualenv</title>
	<atom:link href="http://blog.christopherlawlor.com/tag/virtualenv/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.christopherlawlor.com</link>
	<description>Adventures in Freelancing</description>
	<lastBuildDate>Thu, 18 Aug 2011 13:12:11 +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>How to Quickly Open Virtualenvs on Windows</title>
		<link>http://blog.christopherlawlor.com/2010/06/how-to-quickly-open-virtualenvs-on-windows/</link>
		<comments>http://blog.christopherlawlor.com/2010/06/how-to-quickly-open-virtualenvs-on-windows/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 14:59:09 +0000</pubDate>
		<dc:creator>clawlor</dc:creator>
				<category><![CDATA[Dev Tools]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[console2]]></category>
		<category><![CDATA[virtualenv]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.christopherlawlor.com/?p=44</guid>
		<description><![CDATA[I develop on both Windows and Linux. In fact, I often work on the same projects in both environments. In general, I find both environments to be mostly the same, as far as Python development is concerned. Mostly the same that is, except that virtualenvwrapper isn&#8217;t available on windows. If you&#8217;re not familiar with virtualenvwrapper,]]></description>
			<content:encoded><![CDATA[<p>I develop on both Windows and Linux. In fact, I often work on the same projects in both environments.</p>
<p>In general, I find both environments to be mostly the same, as far as Python development is concerned. Mostly the same that is, except that virtualenvwrapper isn&#8217;t available on windows.</p>
<p>If you&#8217;re not familiar with <a href="http://www.doughellmann.com/projects/virtualenvwrapper/">virtualenvwrapper</a>, it is a brilliant shell script that makes virtualenv super easy to work with. I highly recommend it (except of course if you&#8217;re on Windows)</p>
<p>One of the best things about virtualenvwrapper is it lets you quickly and easily activate any available virtualenv with the `workon` command.</p>
<pre class="brush: html">
$ workon virtualenv_name

(virtualenv_name)/path/to/project/dir/$
</pre>
<p>Not only does it activate the environment, but it will also automatically &#8216;cd&#8217; you to the project&#8217;s working directory. You have to set the up manually but it is super simple, just add the &#8216;cd&#8217; command to the &#8216;postactivate&#8217; hook that virtualenvwrapper sets up in the virtualenv&#8217;s directory.</p>
<p>So, no virtualenvwrapper for Windows, but there are other ways to get a command shell which is already good to go for a given project.</p>
<p>In fact, it only takes a simple shortcut to cmd.exe with a few arguments. Create a new shortcut using the right-click context menu, then set</p>
<ul>
<li>Target: %windir%\system32\cmd.exe /k &#8220;c:\path\to\env\Scripts\activate&#8221;</li>
<li>Start In: c:\path\to\project\dir</li>
</ul>
<p>The /k switch runs the activate script in the same shell, instead of starting a new shell.<br />
<div id="attachment_45" class="wp-caption alignnone" style="width: 386px"><a href="http://blog.christopherlawlor.com/wp-content/uploads/2010/06/shortcut.png"><img src="http://blog.christopherlawlor.com/wp-content/uploads/2010/06/shortcut.png" alt="" title="Shortcut to activate your virtualenv" width="376" height="526" class="size-full wp-image-45" /></a><p class="wp-caption-text">Activate and cd to your project</p></div></p>
<p>Another approach is to simply create a batch script on your path, which first cd&#8217;s to the project directory, then runs the activate script. I personally prefer the shortcut approach, but both are effective.</p>
<p>If you&#8217;re using <a href="http://sourceforge.net/projects/console/">Console2</a>, you have two options. You can use the same approach as above, just replace the path to cmd.exe in your shortcut or batch script with the path to your Console2.exe.</p>
<p>Console2 also lets you define tabs for quickly opening a desired environment. In Edit > Settings > Tabs, click Add:<br />
<div id="attachment_46" class="wp-caption alignnone" style="width: 547px"><a href="http://blog.christopherlawlor.com/wp-content/uploads/2010/06/console2.png"><img src="http://blog.christopherlawlor.com/wp-content/uploads/2010/06/console2.png" alt="Console2 settings window" title="console2" width="537" height="553" class="size-full wp-image-46" /></a><p class="wp-caption-text">Console 2 Edit > Settings > Tabs</p></div></p>
<p>There is a slight twist &#8211; you need to specify an executable in the shell argument, you can&#8217;t just put the path to the activate script or you&#8217;ll get an error.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.christopherlawlor.com/2010/06/how-to-quickly-open-virtualenvs-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blog.christopherlawlor.com/tag/virtualenv/feed/ ) in 0.27337 seconds, on Feb 6th, 2012 at 5:19 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 6th, 2012 at 6:19 am UTC -->
