unable to execute to a python script

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri Jun 22 02:43:20 CEST 2007

En Thu, 21 Jun 2007 12:47:30 -0300, Bala Subramanyam vemu  
<balu.vemu at gmail.com> escribió:

> It executes fine in the  python shell, but the problem is in when i  
> execute
> as a  python script  i get the following error
> DCA-TestMachine:~/python_scripts # python2.5 -v rpmqa.py

> # /root/python_scripts/rpm.pyc matches /root/python_scripts/rpm.py
> import rpm # precompiled from /root/python_scripts/rpm.pyc
> Traceback (most recent call last):
>   File "rpmqa.py", line 1, in <module>
>     import rpm
>   File "/root/python_scripts/rpm.py", line 10, in <module>
>     main()
>   File "/root/python_scripts/rpm.py", line 3, in main
>     tss= rpm.TransactionSet()
> AttributeError: 'module' object has no attribute 'TransactionSet'

You have a rpm.py in your python_scripts directory, and it shadows the  
right one. Rename or delete your rpm.py

> I dont know what path I should set the PYTHONHOME PYTHONPATH .etc..
> variables

Usually, nothing.

Gabriel Genellina

More information about the Python-list mailing list