AttributeError: 'module' object has no attribute 'App'

Hi All,

A newbie question ... I got the 2.8 source to build with unicode
enabled in debug mode. However, upon attempting to run demo.py I get:
Traceback (most recent call last):
  File "demo.py", line 3, in <module>
    import Main
  File "/home/pstanczyk/Downloads/wxPython-src-2.8.10.1/wxPython/demo/
Main.py", line 355, in <module>
    class MyLog(wx.PyLog):
AttributeError: 'module' object has no attribute 'PyLog'

Furthermore, trying the hello world example from the wiki I get:
import wx

app = wx.App(False)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'App'

Clearly, I am missing something - any tips warmly welcome

Many thanks in advance

Piotr

python2.5
Python 2.5.1 (r251:54863, Oct 10 2008, 11:26:39)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import wx
dir(wx)

['__builtins__', '__doc__', '__file__', '__name__', '__path__']

Hi All,

A newbie question ... I got the 2.8 source to build with unicode
enabled in debug mode. However, upon attempting to run demo.py I get:
Traceback (most recent call last):
   File "demo.py", line 3, in<module>
     import Main
   File "/home/pstanczyk/Downloads/wxPython-src-2.8.10.1/wxPython/demo/
Main.py", line 355, in<module>
     class MyLog(wx.PyLog):
AttributeError: 'module' object has no attribute 'PyLog'

Furthermore, trying the hello world example from the wiki I get:
import wx

app = wx.App(False)

Traceback (most recent call last):
   File "<stdin>", line 1, in<module>
AttributeError: 'module' object has no attribute 'App'

Clearly, I am missing something - any tips warmly welcome

Check where the wx module is coming from and verify that it is the one you just built:

···

On 4/14/10 11:08 AM, Piotr wrote:

  >>> import wx
  >>> print wx.__file__

--
Robin Dunn
Software Craftsman

Thanks, this is what I get

cd wxPython-src-2.8.10.1/wxPython
python2.5
import wx

print wx.file
wx/init.pyc

this is the right location, but is it what I should be seeing?

Piotr

···

On Wed, Apr 14, 2010 at 1:52 PM, Robin Dunn robin@alldunn.com wrote:

On 4/14/10 11:08 AM, Piotr wrote:

Hi All,

A newbie question … I got the 2.8 source to build with unicode

enabled in debug mode. However, upon attempting to run demo.py I get:

Traceback (most recent call last):

File “demo.py”, line 3, in

 import Main

File "/home/pstanczyk/Downloads/wxPython-src-2.8.10.1/wxPython/demo/

Main.py", line 355, in

 class MyLog(wx.PyLog):

AttributeError: ‘module’ object has no attribute ‘PyLog’

Furthermore, trying the hello world example from the wiki I get:

import wx

app = wx.App(False)
Traceback (most recent call last):

File “”, line 1, in

AttributeError: ‘module’ object has no attribute ‘App’

Clearly, I am missing something - any tips warmly welcome

Check where the wx module is coming from and verify that it is the one you just built:

import wx

print wx.file

Robin Dunn

Software Craftsman

http://wxPython.org

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

To unsubscribe, reply using “remove me” as the subject.

That path is okay, but there should be a whole heck of a lot more in the dir(wx)... Take a look in the wx folder and see what it is doing. The __init__.py file should be importing everything from the core modules so it's all in the wx namespace.

···

On 4/14/10 3:21 PM, Piotr Stanczyk wrote:

Thanks, this is what I get

> cd wxPython-src-2.8.10.1/wxPython
> python2.5
> import wx
>>> print wx.__file__
wx/__init__.pyc

this is the right location, but is it what I should be seeing?

--
Robin Dunn
Software Craftsman

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

I thought that there should be more in there ... in the wx folder the
__init__.py file is there but is empty.

Any thoughts?

Piotr

···

On Thu, Apr 15, 2010 at 9:44 PM, Robin Dunn <robin@alldunn.com> wrote:

On 4/14/10 3:21 PM, Piotr Stanczyk wrote:

Thanks, this is what I get

> cd wxPython-src-2.8.10.1/wxPython
> python2.5
> import wx
>>> print wx.__file__
wx/__init__.pyc

this is the right location, but is it what I should be seeing?

That path is okay, but there should be a whole heck of a lot more in the
dir(wx)... Take a look in the wx folder and see what it is doing. The
__init__.py file should be importing everything from the core modules so
it's all in the wx namespace.

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Reinstall wx?

···

On Apr 20, 11:26 am, Piotr Stanczyk <piotr.stanc...@gmail.com> wrote:

I thought that there should be more in there ... in the wx folder the
__init__.py file is there but is empty.

Any thoughts?

Piotr

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Start from a clean source tree and try redoing the build, redirecting the build output to a file. If you end up with the problem again then examin this file for anything having to do with the installation steps and what it is doing with that folder.

···

On 4/20/10 9:26 AM, Piotr Stanczyk wrote:

I thought that there should be more in there ... in the wx folder the
__init__.py file is there but is empty.

Any thoughts?

--
Robin Dunn
Software Craftsman

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

For what it’s worth, I had this same error when using my system-wide Python installation, but resolved this error by using python.app (installed via Anaconda). Here are all the steps I took to fix this problem:

···

On Tuesday, April 20, 2010 at 1:53:07 PM UTC-4, Mike Driscoll wrote:

On Apr 20, 11:26 am, Piotr Stanczyk piotr.stanc...@gmail.com wrote:

I thought that there should be more in there … in the wx folder the

init.py file is there but is empty.

Any thoughts?

Piotr

Reinstall wx?


Mike Driscoll

Blog: http://blog.pythonlibrary.org


To unsubscribe, send email to wxPython-user...@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en