If you are going through “Think Python” you’ ll see that in chapter 4, you will be asked to install Swampy. What disappoints me about this is, there are no clear instructions on how to get the darn thing installed Making this book, not really aimed at novices imo, other than that it is a great book.
Before you do anything, I suggest to check which version of python you have running right now. You do this by opening the terminal and simply typing “python” without the quotation marks. It looks like this.
As you can see I am running python 2.7.3, the ”3″ isn’t important for this tutorial.
Now, we are going to get “Easy Install” , go to this site and scroll all the way down until you see this.
Click and download the version of setup tools which correspondents with the current version of python you have ( in my case it is setuptools-0.6c11-py2.7.egg). Make sure to download it into your downloads folder.
Open terminal (if you are still in python, press “ctrl” and “d” at the same time to exit) and move to the downloads folder. You do this by typing “cd ~/Downloads”, I also suggest logging in as root after you are in the downloads folder.
After you have logged in as root, you have to run the file you downloaded as a script, you do this by typing ” sh setuptools-0.6c11-py2.7.egg” .
After the installation is done, return to your home directory by typing “cd ~”. Now you are ready to install Swampy, finally! Type in terminal “easy_install Swampy”.
And you are done!
(If you want to be sure whether Swampy is installed or not, just type ” import swampy.TurtleWorld” in python. If you don’t get a message it’s installed, it will look like this:
If it is not installed, you’ ll get some scary message )
Remember you can always do the cliccie for a larger piccie!
March 27, 2018 at 8:51 am
it worked!!!!! God bless you
March 27, 2018 at 11:36 am
Well, I am glad to see the article is still relevant! 😀