473,378 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

import question on wx ?

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 '06 #1
5 12525
di********@gmail.com 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 '06 #2
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:
di********@gmail.com 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 '06 #3
John Salerno wrote:
di********@gmail.com 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

Jul 27 '06 #4
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:
di********@gmail.com 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 '06 #5
wrote in news:11*********************@i3g2000cwc.googlegrou 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/
Jul 27 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stian Søiland | last post by:
all examples performed with: Python 2.3+ (#2, Aug 10 2003, 11:09:33) on linux2 (2, 3, 0, 'final', 1) This is a recursive import:
0
by: Vio | last post by:
Hi, I've been trying to embed (statically) wxPy alongside an embedded py interpreter on a linux/gtk box. At one point, for some reason misc.o linking reported "multiple definitions of...
0
by: John Roth | last post by:
I've found a case where it seems that Python is importing two copies of a module without any reason or indication. It took me a while to verify that this is what is occuring: I had to write a...
5
by: Steve Holden | last post by:
This is even stranger: it makes it if I import the module a second time: import dbimp as dbimp import sys if __name__ == "__main__": dbimp.install() #k = sys.modules.keys() #k.sort() #for...
1
by: mark | last post by:
In Access 2000 and 2002, I have created an import specification to import the fixed-width recordset below into an existing table. I am having strange problems with the import of the date and time...
4
by: Bruce W. Roeser | last post by:
All, I'm reading a book by Charles Petzold (Programming VS.Net). Pretty good content but am confused about the difference. From the text: ...
2
by: Jon | last post by:
It appears that (windows) python searches in the current working directory before looking in the local site-packages directory, or that '.' comes first in sys.path? The problem arises when I made...
7
by: Ron Adam | last post by:
from __future__ import absolute_import Is there a way to check if this is working? I get the same results with or without it. Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) on win 32 ...
5
by: W. Watson | last post by:
Is there a single source that explains these statements? ------------------------------ from Tkinter import * from Numeric import * import Image import ImageChops import ImageTk import time...
9
by: rsoh.woodhouse | last post by:
Hi, I'm trying to work out some strange (to me) behaviour that I see when running a python script in two different ways (I've inherited some code that needs to be maintained and integrated with...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.