Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > import question on wx ?

Reply
Thread Tools

import question on wx ?

 
 
diffuser78@gmail.com
Guest
Posts: n/a
 
      07-27-2006
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

 
Reply With Quote
 
 
 
 
John Salerno
Guest
Posts: n/a
 
      07-27-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) 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.
 
Reply With Quote
 
 
 
 
diffuser78@gmail.com
Guest
Posts: n/a
 
      07-27-2006
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:
> (E-Mail Removed) 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.


 
Reply With Quote
 
SPE - Stani's Python Editor
Guest
Posts: n/a
 
      07-27-2006
John Salerno wrote:
> (E-Mail Removed) 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/showthre...light=wxpython

Stani

 
Reply With Quote
 
diffuser78@gmail.com
Guest
Posts: n/a
 
      07-27-2006
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:
> (E-Mail Removed) 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.


 
Reply With Quote
 
Rob Williscroft
Guest
Posts: n/a
 
      07-27-2006
wrote in news:(E-Mail Removed) ps.com 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
to use import java.lang.* or import java.lang.Math or none at all? JPractitioner Java 13 02-24-2006 08:48 PM
XML Schema question - does "import" import elements? Vitali Gontsharuk XML 2 08-25-2005 07:33 PM
IMPORT STATIC; Why is "import static" file scope? Why not class scope? Paul Opal Java 12 10-10-2004 11:01 PM
GTK import doesn't import first time Dennis Python 2 08-18-2003 10:00 PM
import/from import question Artur M. Piwko Python 1 07-02-2003 07:04 PM



Advertisments