{"id":1527,"date":"2012-04-24T02:28:17","date_gmt":"2012-04-24T06:28:17","guid":{"rendered":"http:\/\/www.rexfeng.com\/blog\/?p=1527"},"modified":"2012-04-24T02:28:17","modified_gmt":"2012-04-24T06:28:17","slug":"learning-regex-the-hard-way","status":"publish","type":"post","link":"https:\/\/www.rexfeng.com\/blog\/2012\/04\/learning-regex-the-hard-way\/","title":{"rendered":"Learning Regex The Hard Way"},"content":{"rendered":"<p>I want to do both the <a href=\"http:\/\/regex.learncodethehardway.org\/\">Regex<\/a> &amp; <a href=\"http:\/\/ruby.learncodethehardway.org\/\">Ruby<\/a> tutorials in <a href=\"http:\/\/learncodethehardway.org\/\">Learning the hard way series<\/a>. C&#8217;mon,\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Regular_expression\">Regex<\/a> is just super useful.<\/p>\n<p>Just installed <a href=\"http:\/\/www.python.org\/getit\/releases\/3.0\/\">Python<\/a>, <a href=\"http:\/\/pypi.python.org\/pypi\/pip\">pip<\/a>, <a href=\"http:\/\/pypi.python.org\/pypi\/distribute\">distribute<\/a>, and <a href=\"http:\/\/code.activestate.com\/pypm\/regetron\/\">Regetron<\/a>. (I&#8217;ve spent most of my time learning Ruby, no Python before).<\/p>\n<p>It wasn&#8217;t so bad using <a href=\"https:\/\/github.com\/mxcl\/homebrew\/wiki\">Homebrew<\/a> and googling for error messages. <a href=\"http:\/\/ascarter.net\/2011\/09\/25\/modern-ruby-development.html\">This guide<\/a> was helpful for me to setup Homebrew &amp; Rails on OSX, but I&#8217;m still using bash.<\/p>\n<p>For Python, I simply ran <strong><code>brew install python3<\/code><\/strong><\/p>\n<p>As Python finished, I got a message that &#8220;Distribute has been installed, so easy_install is available.&#8221;<\/p>\n<p>Okay, so let&#8217;s try <strong><code>easy_install pip<\/code><\/strong><\/p>\n<p>I get unfriendly error messages:<\/p>\n<blockquote><p>error: can&#8217;t create or remove files in install directory<\/p>\n<p>The following error occurred while trying to add or remove files in the<br \/>\ninstallation directory:<\/p>\n<p>[Errno 13] Permission denied: &#8216;\/Library\/Python\/2.7\/site-packages\/test-easy-install-42140.write-test&#8217;<\/p>\n<p>The installation directory you specified (via &#8211;install-dir, &#8211;prefix, or<br \/>\nthe distutils default setting) was:<\/p>\n<p>\/Library\/Python\/2.7\/site-packages\/<\/p>\n<p>Perhaps your account does not have write access to this directory? If the<br \/>\ninstallation directory is a system-owned directory, you may need to sign in<br \/>\nas the administrator or &#8220;root&#8221; account. If you do not have administrative<br \/>\naccess to this machine, you may wish to choose a different installation<br \/>\ndirectory, preferably one that is listed in your PYTHONPATH environment<br \/>\nvariable.<\/p>\n<p>For information on other options, you may wish to consult the<br \/>\ndocumentation at:<\/p>\n<p>http:\/\/peak.telecommunity.com\/EasyInstall.html<\/p>\n<p>Please make the appropriate changes for your system and try again.<\/p><\/blockquote>\n<p>After googling to no real obvious answer, I simply ran <strong><code>sudo easy_install pip<\/code><\/strong><\/p>\n<p>It works!<\/p>\n<p>Then for distribute &amp; Regetron, it was the same thing (I had to use sudo). <strong><code>sudo pip install distribute<\/code><\/strong> works. I tried to run <strong><code>pip install regetron<\/code><\/strong>, but I had to use <strong><code>sudo pip install regetron<\/code><\/strong> instead.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I want to do both the Regex &amp; Ruby tutorials in Learning the hard way series. C&#8217;mon,\u00a0Regex is just super useful. Just installed Python, pip, distribute, and Regetron. (I&#8217;ve spent most of my time learning Ruby, no Python before). It wasn&#8217;t so bad using Homebrew and googling for error messages. This guide was helpful for [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-1527","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/1527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/comments?post=1527"}],"version-history":[{"count":8,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/1527\/revisions"}],"predecessor-version":[{"id":1535,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/posts\/1527\/revisions\/1535"}],"wp:attachment":[{"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/media?parent=1527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/categories?post=1527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rexfeng.com\/blog\/wp-json\/wp\/v2\/tags?post=1527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}