import question on wx ?

Discussion in 'Python' started by diffuser78@gmail.com, Jul 27, 2006.

  1. Guest

    I have installed wx and everything looks fine. I have written a small
    app that uses wx.

    When I run my program from the console like
    ubuntu $ python PROGRAM_NAME.py

    it gives error
    Traceback (most recent call last):
    File "Project.py", line 6, in ?
    import wx
    ImportError: No module named wx


    But if I run the program from SPE (Stani's Python Editor) it just runs
    fine.


    How can I resolve such an issue. Please help. Is my path settting worng
    ...?

    Every help is appreciated.

    Thanks
    , Jul 27, 2006
    #1
    1. Advertising

  2. John Salerno Guest

    wrote:
    > I have installed wx and everything looks fine. I have written a small
    > app that uses wx.
    >
    > When I run my program from the console like
    > ubuntu $ python PROGRAM_NAME.py
    >
    > it gives error
    > Traceback (most recent call last):
    > File "Project.py", line 6, in ?
    > import wx
    > ImportError: No module named wx
    >
    >
    > But if I run the program from SPE (Stani's Python Editor) it just runs
    > fine.


    It could be that the Python version you are using to launch the app from
    the console is the preinstalled version on your system and therefore
    wxPython wasn't installed into that version. Do you have multiple
    versions of Python installed? Probably SPE is using the other version
    which *does* have wxPython in it.
    John Salerno, Jul 27, 2006
    #2
    1. Advertising

  3. Guest

    I think what you say makes perfect sense

    I am using 2.4.2 python (I typed pthon -V on console to get)

    How can I find what my SPE editor is using ?




    John Salerno wrote:
    > wrote:
    > > I have installed wx and everything looks fine. I have written a small
    > > app that uses wx.
    > >
    > > When I run my program from the console like
    > > ubuntu $ python PROGRAM_NAME.py
    > >
    > > it gives error
    > > Traceback (most recent call last):
    > > File "Project.py", line 6, in ?
    > > import wx
    > > ImportError: No module named wx
    > >
    > >
    > > But if I run the program from SPE (Stani's Python Editor) it just runs
    > > fine.

    >
    > It could be that the Python version you are using to launch the app from
    > the console is the preinstalled version on your system and therefore
    > wxPython wasn't installed into that version. Do you have multiple
    > versions of Python installed? Probably SPE is using the other version
    > which *does* have wxPython in it.
    , Jul 27, 2006
    #3
  4. John Salerno wrote:
    > wrote:
    > > I have installed wx and everything looks fine. I have written a small
    > > app that uses wx.
    > >
    > > When I run my program from the console like
    > > ubuntu $ python PROGRAM_NAME.py
    > >
    > > it gives error
    > > Traceback (most recent call last):
    > > File "Project.py", line 6, in ?
    > > import wx
    > > ImportError: No module named wx
    > >
    > >
    > > But if I run the program from SPE (Stani's Python Editor) it just runs
    > > fine.

    >
    > It could be that the Python version you are using to launch the app from
    > the console is the preinstalled version on your system and therefore
    > wxPython wasn't installed into that version. Do you have multiple
    > versions of Python installed? Probably SPE is using the other version
    > which *does* have wxPython in it.

    To see which versions SPE uses, go to Help>About and the versions are
    mentioned under "Program info". Compare that to the version which
    appears if you just type "python" in the command prompt. I've posted a
    "howto" on the ubuntuforums how to install the latest wxpython and SPE
    on Ubuntu:
    http://www.ubuntuforums.org/showthread.php?t=218001&highlight=wxpython

    Stani
    SPE - Stani's Python Editor, Jul 27, 2006
    #4
  5. Guest

    That right..on my console it shows python 2.4.2 and on SPE it shows
    2.4.3. The wxPython is working fine in SPE i.e with Python 2.4.3.

    How can I make sure that when I type python on console I get the 2.4.3
    ?

    Every help is greatly appreciated.

    Thanks


    John Salerno wrote:
    > wrote:
    > > I have installed wx and everything looks fine. I have written a small
    > > app that uses wx.
    > >
    > > When I run my program from the console like
    > > ubuntu $ python PROGRAM_NAME.py
    > >
    > > it gives error
    > > Traceback (most recent call last):
    > > File "Project.py", line 6, in ?
    > > import wx
    > > ImportError: No module named wx
    > >
    > >
    > > But if I run the program from SPE (Stani's Python Editor) it just runs
    > > fine.

    >
    > It could be that the Python version you are using to launch the app from
    > the console is the preinstalled version on your system and therefore
    > wxPython wasn't installed into that version. Do you have multiple
    > versions of Python installed? Probably SPE is using the other version
    > which *does* have wxPython in it.
    , Jul 27, 2006
    #5
  6. wrote in news: in
    comp.lang.python:

    >
    > I think what you say makes perfect sense
    >
    > I am using 2.4.2 python (I typed pthon -V on console to get)
    >
    > How can I find what my SPE editor is using ?
    >


    Wherever you can run python you can find the version by running
    the following bit of python

    import sys
    print sys.version

    For example I currently get:

    running: python ...\test-1.py
    2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]

    from my homebrew (wxPython) editor.

    Rob.
    --
    http://www.victim-prime.dsl.pipex.com/
    Rob Williscroft, Jul 27, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Opal
    Replies:
    12
    Views:
    927
    Paul Opal
    Oct 11, 2004
  2. JPractitioner
    Replies:
    13
    Views:
    20,119
    Roedy Green
    Feb 24, 2006
  3. Vitali Gontsharuk
    Replies:
    2
    Views:
    555
    Vitali Gontsharuk
    Aug 25, 2005
  4. Artur M. Piwko

    import/from import question

    Artur M. Piwko, Jun 29, 2003, in forum: Python
    Replies:
    1
    Views:
    827
    Peter Hansen
    Jul 2, 2003
  5. Dennis
    Replies:
    2
    Views:
    489
    Dennis
    Aug 18, 2003
Loading...

Share This Page