beginner

Hi!

I am a complete beginner to Python and wxPython.

I have just installed wx on my machine but i m not able to run the samples.

My environment looks like this …

$PYTHONPATH=/scratch/kmaheshw/wxPython-src-2.6.3.3/wxPython

$WX_CONFIG=/scratch/kmaheshw/wxPython/bld/bin/wx-config

$LD_LIBRARY_PATH=/scratch/kmaheshw/wxPython/bld/lib

When I try to run the demo program as follows:

demo > python2.3 demo.py

I get following error …

Traceback (most recent call last):

File “demo.py”, line 3, in ?

import Main

File “/scratch/kmaheshw/wxPython-src-2.6.3.3/wxPython/demo/Main.py”, line 32, in ?

import wx                  # This module uses the new wx namespace

ImportError: No module named wx

What should I do?

Thanks,

k.

Ketan Maheshwari wrote:

Hi!
I am a complete beginner to Python and wxPython.
I have just installed wx on my machine but i m not able to run the samples.
My environment looks like this ...

$PYTHONPATH=/scratch/kmaheshw/wxPython-src-2.6.3.3/wxPython
$WX_CONFIG=/scratch/kmaheshw/wxPython/bld/bin/wx-config
$LD_LIBRARY_PATH=/scratch/kmaheshw/wxPython/bld/lib

When I try to run the demo program as follows:
demo > python2.3 demo.py

I get following error ...
Traceback (most recent call last):
  File "demo.py", line 3, in ?
    import Main
  File "/scratch/kmaheshw/wxPython-src-2.6.3.3/wxPython/demo/Main.py", line 32, in ?
    import wx # This module uses the new wx namespace
ImportError: No module named wx

What should I do?

Did you follow all of the build steps? If you didn't do the build step for wxPython then wxPython-src-2.6.3.3/wxPython/wx won't get a __init__.py file copied into it and you could end up with this error.

http://wxpython.org/builddoc.php

···

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

I think I did follow the steps to install it.
The file you mention is there ...

···

************
py > pwd
/scratch/kmaheshw/wxPython-src-2.6.3.3/wxPython/wx/py
py > file __init.py__
__init__.py: a python script text executable
**************

Ketan Maheshwari wrote:

Hi!
I am a complete beginner to Python and wxPython.
I have just installed wx on my machine but i m not able to run the
samples.
My environment looks like this ...

$PYTHONPATH=/scratch/kmaheshw/wxPython-src-2.6.3.3/wxPython
$WX_CONFIG=/scratch/kmaheshw/wxPython/bld/bin/wx-config
$LD_LIBRARY_PATH=/scratch/kmaheshw/wxPython/bld/lib

When I try to run the demo program as follows:
demo > python2.3 demo.py

I get following error ...
Traceback (most recent call last):
  File "demo.py", line 3, in ?
    import Main
  File "/scratch/kmaheshw/wxPython-src-2.6.3.3/wxPython/demo/Main.py",
line 32, in ?
    import wx # This module uses the new wx namespace
ImportError: No module named wx

What should I do?

Did you follow all of the build steps? If you didn't do the build step
for wxPython then wxPython-src-2.6.3.3/wxPython/wx won't get a
__init__.py file copied into it and you could end up with this error.

http://wxpython.org/builddoc.php

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

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

--
Ketan C Maheshwari
University of Amsterdam.
cell +31 6 33 975 644

Robin Dunn wrote:

ImportError: No module named wx

Could it be that you have multiple versions of Python installed? This error will occur when you install wxPython to one version, then call your program with a different version (since wxPython is not available to that version).

Robin Dunn wrote:

ImportError: No module named wx

Could it be that you have multiple versions of Python installed? This
error will occur when you install wxPython to one version, then call
your program with a different version (since wxPython is not available
to that version).

could be, as i get this:
which python
python is /usr/bin/python
python is /opt/arch/python/bin/python
i do not have su rights on the system. How could I resolve it?

···

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

--
Ketan C Maheshwari
University of Amsterdam.
cell +31 6 33 975 644

K. Maheshwari wrote:

I think I did follow the steps to install it.
The file you mention is there ...
************
py > pwd
/scratch/kmaheshw/wxPython-src-2.6.3.3/wxPython/wx/py
py > file __init.py__
__init__.py: a python script text executable
**************

You're looking in the wrong directory. Look in /scratch/kmaheshw/wxPython-src-2.6.3.3/wxPython/wx

···

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

John Salerno wrote:

Robin Dunn wrote:

ImportError: No module named wx

Could it be that you have multiple versions of Python installed? This error will occur when you install wxPython to one version, then call your program with a different version (since wxPython is not available to that version).

Since he is setting PYTHONPATH then the problem is that the wxPython in that dir is not built correctly.

···

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