…little BITS of our lives.

Posts tagged ‘Python3.2’

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! 😀


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! 😉