…little BITS of our lives.

Archive for the ‘Uncategorized’ Category

Installing Pygame Again!!! (This time with Fedora 16)

Hi again! This time, a friend of mine asked me to install pygame on his fedora machine to work with python3. Now I don’t have much experience with fedora, but I kinda liked it in the little time I have used it.

Anyways, coming back to the topic, this installation, took my entire afternoon, so I decided to make a post about it.

Fedora is shipped with python2 installed already, so the first thing is to install python3. Now since you are reading this, I will assume you already have python 3 installed.

What you should do is also install the ‘python3-devel’ package. Why?

Because if you don’t, somewhere down the line, your installation progress will stop by an error such as the following:

Image

So, fire up the command line and type in the following:

yum install python3-devel

Oh, one more thing! Do this as root user, but ur system probably already told u that. 😉

Once you are done, we have to install all the dependencies for pygame. These are basically some libraries, some of which might be present in your system already.

Anyways, go ahead and type in:

yum install SDL SDL-devel smpeg smpeg-devel portmidi portmidi-devel ffmpeg ffmpeg-devel

This will install the dependencies that you need in order to install pygame. Now, what we need to do is acquire pygame. You can do this by any method, for example by downloading the zipped file from the pygame website and then extracting it into your computer.

I prefer the method of acquiring pygame through ‘svn‘. Unfortunately, svn might not be installed on your computer. So, you can stick to other methods or ‘install svn’ :D.

If you don’t know what svn is, google it and you will get introduced to something really awesome! Moving ahead, if you decide to install svn, you can do this by:

yum install subversion

Now go and acquire pygame by typing this into your command line.

svn co svn://seul.org/svn/pygame/trunk pygame

The download will begin in a moment, you will see a bunch of text appearing and then when the prompt comes again, move to the pygame folder.

cd pygame

Then type:

python3 config.py

python3 setup.py build

Sometimes an error pops in here, saying something like it can not find ‘-lporttime’. In order to resolve this issue, you just have to create a symbolic link to lportmidi as follows:

Move to /usr/lib

cd /usr/lib

Then type:

ln -s libportmidi.so.0 libporttime.so

For this one line I have this guy to thank: Vzades’s Blog 🙂

And then, just enter

python3 setup.py install

And you are done!!!

Happy times are back again, And I can go back to sipping my cola !!! 😀 😀

Fedora, ur ON!


Advertisements

Installing pyserial on Windows 7 with Python3.2

Well it is time for another easy tutorial on how to install something with python on Windows and that something is pyserial. I am assuming if you are reading this, you already know what pyserial is, but are just having trouble getting it installed with python.

Let me just talk about what problem most people face while performing the install. They get an error like “no python installation found in the registry” and then the installer quits.

To resolve this error, first you need to check whether your windows machine can find the python executable, by which I mean the following:

1. Open up the command prompt and type python.

If you get an error like “python is not recognized as an internal command…bla bla bla…” it means that your     system can not find where your python executable is. We need to solve this issue first and for that we need to set our ‘environment variables‘.

2. So go to Start menu. Right click on computer and select properties. Then go to advanced system properties and select environment variables. Look for the variable ‘Path’, select it and click edit. Python 3.2 is installed in the location ‘C:\Python32‘, so just add this to the path variable.

3. Now close all windows and RESTART your computer. If you don’t restart it, then the changes won’t take place.

4. Now after restarting, to check all if all went well, open the command prompt and then type ‘python‘. What you should get is following:

This prompt tells us that the system can find python executable now. Yay!!! Now we can focus on installing pyserial.

So the next step involves downloading the  file  pyserial-2.6.tar.gz from the pyserial website, extract it and then copy the extracted folder to C:\Python32\Lib\site-packages. Once you are done with that, move to the folder which contains the file ‘setup.py’, using command prompt and enter:

python setup.py install

That’s it!

Have fun with pyserial, and if u have any problems pls post. I will be happy to help! 😀

Finally the long break ends!

Hello again!

I have not been writing much here lately because… umm.. I dunno.
But recently I joined a udacity course on python which has prompted me to make some more interesting posts, which will be coming out soon! Till then, chill and have fun 😀

Installing Pygame with Python 3.2 on Ubuntu 11.04

Okay, so I struggled for about an hour trying to get ‘ pygame ‘ run with Python 3 on my ubuntu 11.04 machine, so I decided to write a post about it.
By default, Ubuntu ships with Python 2.7 installed, so pygame gets installed with python 2.7.
To install it with python3, do the following:
1. Open up the terminal and type the following code:
sudo apt-get install python3-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev
2. Then once all libraries are downloaded and installed, type:
svn co svn://seul.org/svn/pygame/trunk pygame

cd pygame

python3 setup.py build

sudo python3 setup.py install

3. That’s all! You can now run pygame with python3.

I have also updated this on the pygame website, so that no one falls into this trouble again! 😉