The following forum message was posted by owlbrudder at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4407732:
Folks, I am new to Python and Qt4. I am teaching myself by following the instructions at [url]http://zetcode.com/tutorials/pyqt4[/url] and using the PyDev tool in Eclipse. Yesterday, as an alternative, I installed and fired up the Eric IDE. I was not sufficiently impressed to swap away from Eclipse/PyDev, so I exited Eric and shut down my computer for the night. This morning, I am unable to run Python scripts in PyDev, even though they run OK if run from a command line as 'python <scriptname>'. In the Eclipse/PyDev IDE, I try running any script which it was able to run yesterday, before I played with Eric, but the run fails with the following output: [code]Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/site.py", line 73, in <module> __boot() File "/usr/lib/python2.7/site-packages/site.py", line 48, in __boot addsitedir(item) File "/usr/lib64/python2.7/site.py", line 188, in addsitedir addpackage(sitedir, name, known_paths) File "/usr/lib64/python2.7/site.py", line 158, in addpackage exec line File "<string>", line 1, in <module> AttributeError: 'module' object has no attribute 'setdefaultencoding' [/code] I expect I inadvertently did something wrong when I fired up Eric, but I do not know where to start looking. I am a programmer, but have only looked at Python for two days and all my training materials amount to what I can find on the internet - I have no hardcopy manual to browse through. If anyone can help me get my Eclipse/PyDev working again, I would be very grateful. Kind regards, Doug Example script which is failing, but worked yesterday. Copied from [url]http://zetcode.com/tutorials/pyqt4[/url] +++++++++++++++++++++++++++++++++++++++++++++++++++ #!/usr/bin/python # -*- coding: utf-8 -*- # absolute.py import sys from PyQt4 import QtGui class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): label1 = QtGui.QLabel('Zetcode', self) label1.move(15, 10) label2 = QtGui.QLabel('tutorials for programmers', self) label2.move(35, 40) self.setWindowTitle('Absolute') self.resize(250, 150) app = QtGui.QApplication(sys.argv) ex = Example() ex.show() sys.exit(app.exec_()) +++++++++++++++++++++++++++++++++++++++++++++++++++ ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Pydev-users mailing list Pydev-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pydev-users