Newbie can't 'find' wxpython

This is a newbie question. I am having trouble getting wxPython to run.

Under windows98, I have installed Active Python 2.2 which seems to be
working fine.

I have downladed the prebiult binary for wxWindows 2.4.0.

I have installed wxPython in the directory "c:\active22\.

I have added "set wxpython=c:\active22", to autoexec.bat.

Printing "sys.path", shows "c:\active22" as one of the directories in the
Python path.

When I try to run code such as...

from wxPython.wx import *

class MyApp(wxApp):
    def OnInit(self):
        frame = wxFrame(NULL, -1, "Hello from wxPython")
        frame.Show(true)
        self.SetTopWindow(frame)
        return true

app = MyApp(0)
app.MainLoop()

I get the error message....

File
"C:\Python22\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
line 301, in RunScript

    exec codeObject in __main__.__dict__
  
File "C:\Usr\george\wxpy\tut01.py", line 1, in ?
    
from wxPython.wx import *

ImportError: No module named wxPython.wx

If I enter "import wxpython" from the interactive window, I get...

Traceback (most recent call last):

  File "<interactive input>", line 1, in ?

ImportError: No module named wxpython

It seems that I can't get Python to find the wxPython module.

I belive the the correct directory appears in both Python Path and in wxwin.

My small brain is confused... and getting smaller!

As a pre-requisite to use xwWindows, a copiler is listed.

Having dowloaded a binary, I assumed that it would be ready to run. Is this
correct?

Can I run code that calls wxWindows under the'interperter',
or must the code be compiled first? Presently, I don't want to create .EXE
files.

Any suggestions would be both humbley and gratefully appreciated.

Thanks,

George

···

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .

Not even going to try to fix your problems, but just to make a suggestion.

I use the normal python installer (haven't used Active Python) and wxPython.

I don't change anything in the install options.

It works = I'm happy.

Perhaps uninstall & use the default setup.

Chris.

···

----- Original Message -----
From: gdroy@idirect.com
To: wxpython-users@lists.wxwindows.org
Sent: Thursday, March 27, 2003 2:05 PM
Subject: [wxPython-users] Newbie can't 'find' wxpython

This is a newbie question. I am having trouble getting wxPython to run.

Under windows98, I have installed Active Python 2.2 which seems to be
working fine.

I have downladed the prebiult binary for wxWindows 2.4.0.

I have installed wxPython in the directory "c:\active22\.

I have added "set wxpython=c:\active22", to autoexec.bat.

Printing "sys.path", shows "c:\active22" as one of the directories in the
Python path.

When I try to run code such as...

from wxPython.wx import *

class MyApp(wxApp):
    def OnInit(self):
        frame = wxFrame(NULL, -1, "Hello from wxPython")
        frame.Show(true)
        self.SetTopWindow(frame)
        return true

app = MyApp(0)
app.MainLoop()

I get the error message....

File
"C:\Python22\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
line 301, in RunScript

    exec codeObject in __main__.__dict__
  
File "C:\Usr\george\wxpy\tut01.py", line 1, in ?
    
from wxPython.wx import *

ImportError: No module named wxPython.wx

If I enter "import wxpython" from the interactive window, I get...

Traceback (most recent call last):

  File "<interactive input>", line 1, in ?

ImportError: No module named wxpython

It seems that I can't get Python to find the wxPython module.

I belive the the correct directory appears in both Python Path and in wxwin.

My small brain is confused... and getting smaller!

As a pre-requisite to use xwWindows, a copiler is listed.

Having dowloaded a binary, I assumed that it would be ready to run. Is this
correct?

Can I run code that calls wxWindows under the'interperter',
or must the code be compiled first? Presently, I don't want to create .EXE
files.

Any suggestions would be both humbley and gratefully appreciated.

Thanks,

George

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

gdroy@idirect.com wrote:

This is a newbie question. I am having trouble getting wxPython to run.

Under windows98, I have installed Active Python 2.2 which seems to be
working fine.

I have downladed the prebiult binary for wxWindows 2.4.0.

Uh, is this in addition to wxPython? If so it is not needed as wxPython includes a wxWindows DLL.

I have installed wxPython in the directory "c:\active22\.

What is the full path to the wxPython dir? c:\active22\wxPython or something buried far below c:\active22?

I have added "set wxpython=c:\active22", to autoexec.bat.

Where did you get the idea that this is needed? Or did you mean to write PYTHONPATH?

Printing "sys.path", shows "c:\active22" as one of the directories in the
Python path.

When I try to run code such as...

from wxPython.wx import *

class MyApp(wxApp):
    def OnInit(self):
        frame = wxFrame(NULL, -1, "Hello from wxPython")
        frame.Show(true)
        self.SetTopWindow(frame)
        return true

app = MyApp(0)
app.MainLoop()

I get the error message....

File
"C:\Python22\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",

Any reason why you didn't install to the site-packages directory? That's what it's there for.

If I enter "import wxpython" from the interactive window, I get...

Traceback (most recent call last):

  File "<interactive input>", line 1, in ?

ImportError: No module named wxpython

It's case sensitive so you should use wxPython, but if wxPython.wx wasn't found then this won't either.

It seems that I can't get Python to find the wxPython module.

I belive the the correct directory appears in both Python Path and in wxwin.

My small brain is confused... and getting smaller!

As a pre-requisite to use xwWindows, a copiler is listed.

Having dowloaded a binary, I assumed that it would be ready to run. Is this
correct?

Correct.

Can I run code that calls wxWindows under the'interperter',

Yes.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

If c:\activew22\ is set up like a 'normal' Python installation,
there will be a Lib\site-packages subdir, and that's where
wxPython should be installed.
I don't have active Python, just 'python.org' Python and that's where
the wxPython is installed on my system.
HTH,

···

#--------------------------------
Jeff Sasmor
jeff@sasmor.com
----- Original Message -----
From: <gdroy@idirect.com>
To: <wxpython-users@lists.wxwindows.org>
Sent: Wednesday, March 26, 2003 10:35 PM
Subject: [wxPython-users] Newbie can't 'find' wxpython

This is a newbie question. I am having trouble getting wxPython to run.

Under windows98, I have installed Active Python 2.2 which seems to be
working fine.

I have downladed the prebiult binary for wxWindows 2.4.0.

I have installed wxPython in the directory "c:\active22\.

I have added "set wxpython=c:\active22", to autoexec.bat.

Printing "sys.path", shows "c:\active22" as one of the directories in the
Python path.

When I try to run code such as...

from wxPython.wx import *

class MyApp(wxApp):
    def OnInit(self):
        frame = wxFrame(NULL, -1, "Hello from wxPython")
        frame.Show(true)
        self.SetTopWindow(frame)
        return true

app = MyApp(0)
app.MainLoop()

I get the error message....

File
"C:\Python22\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
line 301, in RunScript

    exec codeObject in __main__.__dict__
  
File "C:\Usr\george\wxpy\tut01.py", line 1, in ?
    
from wxPython.wx import *

ImportError: No module named wxPython.wx

If I enter "import wxpython" from the interactive window, I get...

Traceback (most recent call last):

  File "<interactive input>", line 1, in ?

ImportError: No module named wxpython

It seems that I can't get Python to find the wxPython module.

I belive the the correct directory appears in both Python Path and in wxwin.

My small brain is confused... and getting smaller!

As a pre-requisite to use xwWindows, a copiler is listed.

Having dowloaded a binary, I assumed that it would be ready to run. Is this
correct?

Can I run code that calls wxWindows under the'interperter',
or must the code be compiled first? Presently, I don't want to create .EXE
files.

Any suggestions would be both humbley and gratefully appreciated.

Thanks,

George

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

George,

I think you are getting into trouble because you got wxWindows, what you need with Python is wxPython (which includes the wxWindows stuff it needs), currently I am using Python 2.2 but at some point also used ActivePython and an approriate version of wxPython from

http://www.wxpython.org/download.php#binaries

I am on wxPython 2.3.4.2.

See you
Werner

Jeff Sasmor wrote:

···

If c:\activew22\ is set up like a 'normal' Python installation,
there will be a Lib\site-packages subdir, and that's where
wxPython should be installed. I don't have active Python, just 'python.org' Python and that's where
the wxPython is installed on my system.
HTH,
#--------------------------------
Jeff Sasmor
jeff@sasmor.com
----- Original Message ----- From: <gdroy@idirect.com>
To: <wxpython-users@lists.wxwindows.org>
Sent: Wednesday, March 26, 2003 10:35 PM
Subject: [wxPython-users] Newbie can't 'find' wxpython

This is a newbie question. I am having trouble getting wxPython to run.

Under windows98, I have installed Active Python 2.2 which seems to be
working fine.

I have downladed the prebiult binary for wxWindows 2.4.0.

I have installed wxPython in the directory "c:\active22\.

I have added "set wxpython=c:\active22", to autoexec.bat.

Printing "sys.path", shows "c:\active22" as one of the directories in the
Python path.

When I try to run code such as...

from wxPython.wx import *

class MyApp(wxApp):
   def OnInit(self):
       frame = wxFrame(NULL, -1, "Hello from wxPython")
       frame.Show(true)
       self.SetTopWindow(frame)
       return true

app = MyApp(0)
app.MainLoop()

I get the error message....

File
"C:\Python22\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
line 301, in RunScript

   exec codeObject in __main__.__dict__
File "C:\Usr\george\wxpy\tut01.py", line 1, in ?
   from wxPython.wx import *

ImportError: No module named wxPython.wx

If I enter "import wxpython" from the interactive window, I get...

Traceback (most recent call last):

File "<interactive input>", line 1, in ?

ImportError: No module named wxpython

It seems that I can't get Python to find the wxPython module.

I belive the the correct directory appears in both Python Path and in wxwin.

My small brain is confused... and getting smaller!

As a pre-requisite to use xwWindows, a copiler is listed.

Having dowloaded a binary, I assumed that it would be ready to run. Is this
correct?

Can I run code that calls wxWindows under the'interperter',
or must the code be compiled first? Presently, I don't want to create .EXE
files.

Any suggestions would be both humbley and gratefully appreciated.

Thanks,

George

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Chris Munchenberg wrote:

I use the normal python installer (haven't used Active Python) and wxPython.

I don't change anything in the install options.

It works = I'm happy.

I agree. The default install works, fine, and you don't have to mess
weith autoexec.bat.

The one problem I"d look for is that there may be more than one Python
on your system, for instance the one form python.org, and the
activestate one, not to mention different versions. I don't think
windows has an elegant way to have those co-exist, so unless you really
need more than one, get rid of all the others.

Note: it's possible that you could have one Python that you get when
typing "python" at the command line, and another one when double
clicking a *.py file in the GUI.

So:

1) use add/remove applications to remove everything Python
2) check your system for Python installations that may not have been
removed, and delete them. Look for virtually anything with Python in the
name
3) install ActiveState Python and wxPython, using the defaults if
possible.

You should be good to go.

-Chris

-- --
Christopher Barker, Ph.D.
Oceanographer
                                                
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

gdroy@idirect.com wrote:

This is a newbie question. I am having trouble getting wxPython to run.

Under windows98, I have installed Active Python 2.2 which seems to be
working fine.

I have downladed the prebiult binary for wxWindows 2.4.0.

I have installed wxPython in the directory "c:\active22\. [...]

As others have said, you may simply be running into problems because you're not using the defaults. And, did you actually install wxPython, or only wxWindows?? (wxPython includes all that you need of wxWindows, but not vice versa.)

Presuming that you actually *did* install wxPython, and that you *must* have it somewhere other than %Python-dir%\Lib\site-packages, there is a workaround. Presuming that you've installed wxPython directly below c:\active22\, then you can create a file 'wxpython.pth' (or any name ending in .pth) in your c:\Python22 directory. That file should contain a single line 'c:\active22'. At startup, Python will look through any .pth files it sees, and will consider each line of those files as a directory that it should add to sys.path. When you import a module, Python looks for that module in all the directories listed in sys.path, so by adding directories to it you cause Python to search for modules in places other than the default locations.

All this being said, though, you're really better off just installing wxPython in the normal default location (c:\Python22\Lib\site-packages\wxPython). I can't think of a reason to *not* put it there...

Jeff Shannon
Technician/Programmer
Credit International