Python and PyQt (Windows) - AttributeError: 'module' object has not attribute run

alesssia alessia.visconti at gmail.com
Thu Aug 1 05:49:23 EDT 2013


I developed a python3-PyQt4 application (I’m a newbie!) on a 32-bit Linux platform, and I’m experiencing some problems when testing it on Windows platforms (Windows 7 and 8, both 64-bit).

I have a module called Pmc.py that contains two methods: run and main, but only the former is used in the PyQt main class. I import the module using the following statement:

          import Pmc

and I call the function run with the following instruction:

          self.results = Pmc.run(self.p, self.m)

obtaining this error:

          AttributeError: 'module' object has not attribute run

After some tests, I discovered that renaming Pmc.py in pmc.py solves my issue. No problems are present when using Linux both 32 and 64 bit. 
I’m using python 3.3 and PyQt 4. 

What am I missing?

Thanks in advance,
Alessia



More information about the Python-list mailing list