Re: Eric - "No module named MainWindow"

2013-02-18 Thread Phil

On 18/02/13 18:07, Vincent Vande Vyvre wrote:

Le 18/02/13 00:04, Phil a écrit :

...

from PyQt4 import QtCore, QtGui
from ui.MainWindow import MainWindow


As I've sayed in my last post, this is not "ui.MainWindow" but
"ui.mainwindow"



Thanks again Vincent,

Your answer is correct but that wasn't the only problem. Anyway, as I 
said in my previous message, it works now and I'm pleased that I have 
advanced a little with pyqt4.


--
Regards,
Phil
--
http://mail.python.org/mailman/listinfo/python-list


Re: Eric - "No module named MainWindow"

2013-02-18 Thread Vincent Vande Vyvre
Le 18/02/13 00:04, Phil a écrit :
> ...
>
> from PyQt4 import QtCore, QtGui
> from ui.MainWindow import MainWindow
>
As I've sayed in my last post, this is not "ui.MainWindow" but
"ui.mainwindow"
-- 
Vincent V.V.
Oqapy  . Qarte
 . PaQager 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eric - "No module named MainWindow" - solved

2013-02-17 Thread Phil

On 17/02/13 21:35, Vincent Vande Vyvre wrote:

Le 17/02/13 10:08, Phil a écrit :

Thank you for reading this.

I've been playing with Eric all day and I almost have a working GUI
application, but not quite. I have followed the two tutorials on the
Eric site and I'm sure that I haven't miss entered anything and so I
think the error is the result of something missing from my system or
perhaps a path error.

This is the error message:

The debugged program raised the exception unhandled ImportError
"No module named MainWindow"
File: /home/phil/main.py, Line: 4



The solution is to save the various files in their correct directories 
as mentioned in the tutorial.


--
Regards,
Phil
--
http://mail.python.org/mailman/listinfo/python-list


Re: Eric - "No module named MainWindow"

2013-02-17 Thread Phil

On 17/02/13 21:35, Vincent Vande Vyvre wrote:

Le 17/02/13 10:08, Phil a écrit :

Thank you for reading this.

I've been playing with Eric all day and I almost have a working GUI
application, but not quite. I have followed the two tutorials on the
Eric site and I'm sure that I haven't miss entered anything and so I





Are you sure you have a class MainWindow in your ui.MainWindow.py ?

Can you show us the code of this MainWindow ?


Thank you Vincent and Joel. I think I have already tried every 
conceivable combination but I still cannot get past the error message. 
At the risk of burdening the list with lots of code I have decided to 
show the code as it stands. It's substantially that from the mini 
browser example.


This is the auto generated code for Ui_mainWindow.py:

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 
'/home/phil/mainWindow.ui'

#
# Created: Sun Feb 17 15:54:33 2013
#  by: PyQt4 UI code generator 4.9.3
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui

try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s

class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(200, 200)
self.centralWidget = QtGui.QWidget(MainWindow)
self.centralWidget.setObjectName(_fromUtf8("centralWidget"))
self.pushButton = QtGui.QPushButton(self.centralWidget)
self.pushButton.setGeometry(QtCore.QRect(40, 120, 91, 24))
self.pushButton.setObjectName(_fromUtf8("pushButton"))
MainWindow.setCentralWidget(self.centralWidget)

self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):

MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", 
"MainWindow", None, QtGui.QApplication.UnicodeUTF8))


self.pushButton.setText(QtGui.QApplication.translate("MainWindow", 
"PushButton", None, QtGui.QApplication.UnicodeUTF8))



if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
MainWindow = QtGui.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())

This is the code for mainWindow.py"

class MainWindow(QMainWindow, Ui_MainWindow):
"""
Class documentation goes here.
"""
def __init__(self, parent = None):
"""
Constructor
"""
QMainWindow.__init__(self, parent)
self.setupUi(self)

And this is the main script that I had originally used and named new_gui.py:

from PyQt4 import QtCore, QtGui
from ui.MainWindow import MainWindow

if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
ui = MainWindow()
ui.show()
sys.exit(app.exec_())

Finally, for completeness, this is the error message when I attempt to 
execute new_gui.py:


The debugged program raised the exception unhandled ImportError
"No module named mainWindow"
File: /home/phil/new_gui.py, Line: 2

Could it simply be a case of conflict between my file names and the 
module name?


--
Regards,
Phil
--
http://mail.python.org/mailman/listinfo/python-list


Re: Eric - "No module named MainWindow"

2013-02-17 Thread Vincent Vande Vyvre
Le 17/02/13 16:13, Joel Goldstick a écrit :
>
>
>
> On Sun, Feb 17, 2013 at 6:35 AM, Vincent Vande Vyvre
> mailto:vincent.vandevy...@swing.be>> wrote:
>
> Le 17/02/13 10:08, Phil a écrit :
> > Thank you for reading this.
> >
> > I've been playing with Eric all day and I almost have a working GUI
> > application, but not quite. I have followed the two tutorials on the
> > Eric site and I'm sure that I haven't miss entered anything and so I
> > think the error is the result of something missing from my system or
> > perhaps a path error.
> >
> > This is the error message:
> >
> > The debugged program raised the exception unhandled ImportError
> > "No module named MainWindow"
> > File: /home/phil/main.py, Line: 4
> >
> > And this is the code:
> >
> > !/usr/bin/python
> >
> > from PyQt4.QtGui import QApplication
> > from ui.MainWindow import MainWindow
>

> (strip)
>
>
> I just looked at the tutorial that you might be experimenting with on
> this page:
> http://eric-ide.python-projects.org/tutorials/MiniBrowser/index.html
>
> The class MainWindow is in mainwindow.py in the ui folder.  I would
> try this:
>
> from ui.mainwindow import MainWindow

In your initial code, thi's  "ui.MainWindow" not "ui.mainwindow"


-- 
Vincent V.V.
Oqapy  . Qarte
 . PaQager 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eric - "No module named MainWindow"

2013-02-17 Thread Joel Goldstick
On Sun, Feb 17, 2013 at 6:35 AM, Vincent Vande Vyvre <
vincent.vandevy...@swing.be> wrote:

> Le 17/02/13 10:08, Phil a écrit :
> > Thank you for reading this.
> >
> > I've been playing with Eric all day and I almost have a working GUI
> > application, but not quite. I have followed the two tutorials on the
> > Eric site and I'm sure that I haven't miss entered anything and so I
> > think the error is the result of something missing from my system or
> > perhaps a path error.
> >
> > This is the error message:
> >
> > The debugged program raised the exception unhandled ImportError
> > "No module named MainWindow"
> > File: /home/phil/main.py, Line: 4
> >
> > And this is the code:
> >
> > !/usr/bin/python
> >
> > from PyQt4.QtGui import QApplication
> > from ui.MainWindow import MainWindow
> >
> > def main():
> > import sys
> > app = QApplication(sys.argv)
> > wnd = MainWindow()
> > wnd.show()
> > sys.exit(app.exec_())
> >
> > if __name__ == '__main__':
> > main()
> >
> > I have tried mainWindow and mainwindow as well so it appears not to be
> > a case error.
> >
> Are you sure you have a class MainWindow in your ui.MainWindow.py ?
>

I just looked at the tutorial that you might be experimenting with on this
page: http://eric-ide.python-projects.org/tutorials/MiniBrowser/index.html

The class MainWindow is in mainwindow.py in the ui folder.  I would try
this:

from ui.mainwindow import MainWindow





> --
> Vincent V.V.
> Oqapy  . Qarte
>  . PaQager 
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eric - "No module named MainWindow"

2013-02-17 Thread Vincent Vande Vyvre
Le 17/02/13 10:08, Phil a écrit :
> Thank you for reading this.
>
> I've been playing with Eric all day and I almost have a working GUI
> application, but not quite. I have followed the two tutorials on the
> Eric site and I'm sure that I haven't miss entered anything and so I
> think the error is the result of something missing from my system or
> perhaps a path error.
>
> This is the error message:
>
> The debugged program raised the exception unhandled ImportError
> "No module named MainWindow"
> File: /home/phil/main.py, Line: 4
>
> And this is the code:
>
> !/usr/bin/python
>
> from PyQt4.QtGui import QApplication
> from ui.MainWindow import MainWindow
>
> def main():
> import sys
> app = QApplication(sys.argv)
> wnd = MainWindow()
> wnd.show()
> sys.exit(app.exec_())
>
> if __name__ == '__main__':
> main()
>
> I have tried mainWindow and mainwindow as well so it appears not to be
> a case error.
>
Are you sure you have a class MainWindow in your ui.MainWindow.py ?

Can you show us the code of this MainWindow ?

-- 
Vincent V.V.
Oqapy  . Qarte
 . PaQager 
-- 
http://mail.python.org/mailman/listinfo/python-list


Eric - "No module named MainWindow"

2013-02-17 Thread Phil

Thank you for reading this.

I've been playing with Eric all day and I almost have a working GUI 
application, but not quite. I have followed the two tutorials on the 
Eric site and I'm sure that I haven't miss entered anything and so I 
think the error is the result of something missing from my system or 
perhaps a path error.


This is the error message:

The debugged program raised the exception unhandled ImportError
"No module named MainWindow"
File: /home/phil/main.py, Line: 4

And this is the code:

!/usr/bin/python

from PyQt4.QtGui import QApplication
from ui.MainWindow import MainWindow

def main():
import sys
app = QApplication(sys.argv)
wnd = MainWindow()
wnd.show()
sys.exit(app.exec_())

if __name__ == '__main__':
main()

I have tried mainWindow and mainwindow as well so it appears not to be a 
case error.


--
Regards,
Phil
--
http://mail.python.org/mailman/listinfo/python-list