Sunday, January 13, 2008

Problem installing pyParallel module in python

When they said experimental, I didn't expect this much. I mean; a bug even in the installer??? Sheesh! But thanks to the simplicity of python, I could understand the bug and find a solution. If it was for C++ or Java, I would have simply dropped my whole project! ;)

Now that I've found a solution and I couldn't find it listed in the first three pages of Google search results, I want to share it...

My problem was that when I tried to run and install the pyParallel module:
python setup.py install

I got something like:
running install
running build
running build_py
Traceback (most recent call last):
File "setup.py", line 19, in
package_data = data_files
File "/usr/lib64/python2.5/distutils/core.py", line 151, in setup
dist.run_commands()
.
.
.
.
file[plen:] for file in self.find_data_files(package, src_dir)
File "/usr/lib64/python2.5/distutils/command/build_py.py", line 128, in find_data_files
globs = (self.package_data.get('', [])
AttributeError: 'NoneType' object has no attribute 'get'


Even if looks like we're in deep sh**, we're actually not...
Its just a simple logical error in the way the function is called. In the setup.py,
the function setup should have been called with an argument, "package_data = a dictionary value pair of what & which dependency file is to be installed" if the os is 'nt' & you don't need to give that package_data argument if the os is something else(perhaps there is a default value in the function definition). But our setup.py passes a "package_data = None". So all we have to do is to call the setup function properly without passing a "package_data = None" argument.
Here's what I did to the setup.py:

#!/usr/bin/env python
from distutils.core import setup

import os
args={"name" : "pyparallel",
"description":"Python Parallel Port Extension",
"version":"0.2", "author":"Chris Liechti",
"author_email":"cliechti@gmx.net",
"url":"http://pyserial.sourceforge.net/",
"packages":['parallel'],
"license":"Python",
"long_description":"Python Parallel Port Extension for Win32, Linux, BSD",
}

if os.name == 'nt': args["package_data"] = {'parallel': ['simpleio.dll']}

setup(**args)

Thursday, December 13, 2007

Sunday, December 2, 2007

Learnt HTML scripting from: HTML Source

Wednesday, November 7, 2007



What City Should You Live In?

You should live in Los Angeles. You are snarky, headstrong, and will step on toes to get where you want. It takes a certain type of confidence to make it in sunny L.A., and you may have what it takes!
Find Your Character @ BrainFall.com

What Kind of Girl Will I Fall For?



What Kind of Girl Will You Fall For?

You will fall part for the cutie. You like girls with a personality. She's got to have a nice smile and a sense of humor. Although she doesn't have to be a model, she has to be that girl-next-door.
You will fall part for the independent woman. You like girls that'll put up a fight with their words and their fists. Her conversation must be stimulating and controversial. She's got to have her own friends, her own car, and her own place. Most importantly, she can't be a "barnacle-on-a-whale" type.
Find Your Character @ BrainFall.com

Saturday, October 20, 2007

Good

It's working now...

Problem

Why isn't my blog working??