Python论坛  - 讨论区

标题:[python-chinese] please help me! about wxPython in Redhat AS 4

2005年09月28日 星期三 16:26

Leo Jay python.leojay at gmail.com
Wed Sep 28 16:26:21 HKT 2005

Dear All,

I'd like to install wxPython in my Redhat AS 4,
I have downloaded both
wxPython-common-gtk2-unicode-2.6.1.0-fc2_py2.4.i386.rpm and 
wxPython2.6-gtk2-unicode-2.6.1.0-fc2_py2.4.i386.rpm packages from
www.wxpython.org.

After I installed these two packages successfully, what should i do now?

i tried to import wx in python, but python just returned an error:
Traceback (most recent call last):
  File "", line 1, in ?
ImportError: No module named wx

Who can help me, please?

BTW, i can't input Chinese in Linux, sorry...
but i can read Chinese characters,

Thanks


--
Best Regards,
Leo Jay

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 16:40

limodou limodou at gmail.com
Wed Sep 28 16:40:42 HKT 2005

2005/9/28, Leo Jay <python.leojay at gmail.com>:
> Dear All,
>
> I'd like to install wxPython in my Redhat AS 4,
> I have downloaded both
> wxPython-common-gtk2-unicode-2.6.1.0-fc2_py2.4.i386.rpm and
> wxPython2.6-gtk2-unicode-2.6.1.0-fc2_py2.4.i386.rpm packages from
> www.wxpython.org.
>
> After I installed these two packages successfully, what should i do now?
>
> i tried to import wx in python, but python just returned an error:
> Traceback (most recent call last):
>   File "", line 1, in ?
> ImportError: No module named wx
>
> Who can help me, please?
>
> BTW, i can't input Chinese in Linux, sorry...
> but i can read Chinese characters,
>
> Thanks
>
>

好象要把wx 和wxPython作一个符号链接到site-packages目录下就行了。再试试。


--
I like python!
My Donews Blog: http://www.donews.net/limodou

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 16:43

Qiangning Hong hongqn at gmail.com
Wed Sep 28 16:43:23 HKT 2005

Leo Jay wrote:
> Dear All,
> 
> I'd like to install wxPython in my Redhat AS 4,
> I have downloaded both
> wxPython-common-gtk2-unicode-2.6.1.0-fc2_py2.4.i386.rpm and 
> wxPython2.6-gtk2-unicode-2.6.1.0-fc2_py2.4.i386.rpm packages from
> www.wxpython.org.
> 
> After I installed these two packages successfully, what should i do now?
> 
> i tried to import wx in python, but python just returned an error:
> Traceback (most recent call last):
>   File "", line 1, in ?
> ImportError: No module named wx
> 
> Who can help me, please?

试试看:
# echo wx-2.6-gtk2-unicode > /usr/lib/python2.4/site-packages/wx.pth

-- 
Qiangning Hong
http://www.hn.org/hongqn (RSS: http://feeds.feedburner.com/hongqn)

Registered Linux User #396996
Get Firefox! <http://www.spreadfirefox.com/?q=affiliates&id;=67907&t;=1>
Thunderbird! <http://www.spreadfirefox.com/?q=affiliates&id;=67907&t;=183>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 17:04

Leo Jay python.leojay at gmail.com
Wed Sep 28 17:04:28 HKT 2005

On 9/28/05, limodou <limodou at gmail.com> wrote:
> 好象要把wx 和wxPython作一个符号链接到site-packages目录下就行了。再试试。
>
>
> --
> I like python!
> My Donews Blog: http://www.donews.net/limodou
>

Thanks, but i encountered a new error:
>>> import wx
Traceback (most recent call last):
  File "", line 1, in ?
  File "/usr/local/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/__init__.py",
line 42, in ?
    from wx._core import *
  File "/usr/local/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core.py",
line 4, in ?
    import _core_
ImportError: /usr/local/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core_.so:
undefined symbol: PyUnicodeUCS4_FromEncodedObject


It looks like there is something wrong with Unicode.
if i remembered correctly, i passed enable-unicode flag to ./configure
when compiling python 2.4.1. and the wxPython what i installed is also
an unicode version.
any advices again? ^_^b

--
Best Regards,
Leo Jay

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 17:15

Qiangning Hong hongqn at gmail.com
Wed Sep 28 17:15:41 HKT 2005

Leo Jay wrote:
>>>>import wx
> 
> Traceback (most recent call last):
>   File "", line 1, in ?
>   File "/usr/local/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/__init__.py",
> line 42, in ?
>     from wx._core import *
>   File "/usr/local/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core.py",
> line 4, in ?
>     import _core_
> ImportError: /usr/local/lib/python2.4/site-packages/wx-2.6-gtk2-unicode/wx/_core_.so:
> undefined symbol: PyUnicodeUCS4_FromEncodedObject
> 
> 
> It looks like there is something wrong with Unicode.
> if i remembered correctly, i passed enable-unicode flag to ./configure
> when compiling python 2.4.1. and the wxPython what i installed is also
> an unicode version.
> any advices again? ^_^b

你运行一下
import sys
print sys.maxunicode
结果是什么?


-- 
Qiangning Hong
http://www.hn.org/hongqn (RSS: http://feeds.feedburner.com/hongqn)

Registered Linux User #396996
Get Firefox! <http://www.spreadfirefox.com/?q=affiliates&id;=67907&t;=1>
Thunderbird! <http://www.spreadfirefox.com/?q=affiliates&id;=67907&t;=183>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 17:19

Leo Jay python.leojay at gmail.com
Wed Sep 28 17:19:37 HKT 2005

On 9/28/05, Qiangning Hong <hongqn at gmail.com> wrote:
>
> 你运行一下
> import sys
> print sys.maxunicode
> 结果是什么?
>

>>> import sys
>>> print sys.maxunicode
65535

is that right?

--
Best Regards,
Leo Jay

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 17:31

Qiangning Hong hongqn at gmail.com
Wed Sep 28 17:31:50 HKT 2005

Leo Jay wrote:
> On 9/28/05, Qiangning Hong <hongqn at gmail.com> wrote:
> 
>>你运行一下
>>import sys
>>print sys.maxunicode
>>结果是什么?
>>
> 
> 
>>>>import sys
>>>>print sys.maxunicode
> 
> 65535
> 
> is that right?

那就是你的python不支持UCS4。你最好重新编译python,configure时带上--
enable-unicode=ucs4

可以参考我blog上以前的文章《你的python内部是用什么编码表示unicode的?》
http://www.livejournal.com/users/hongqn/4549.html

-- 
Qiangning Hong
http://www.hn.org/hongqn (RSS: http://feeds.feedburner.com/hongqn)

Registered Linux User #396996
Get Firefox! <http://www.spreadfirefox.com/?q=affiliates&id;=67907&t;=1>
Thunderbird! <http://www.spreadfirefox.com/?q=affiliates&id;=67907&t;=183>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 17:56

nEO (a.k.a. gentoo.cn) gentoo.cn at gmail.com
Wed Sep 28 17:56:06 HKT 2005

2005/9/28, Qiangning Hong <hongqn at gmail.com>:
> 那就是你的python不支持UCS4。你最好重新编译python,configure时带上--
> enable-unicode=ucs4
>
> 可以参考我blog上以前的文章《你的python内部是用什么编码表示unicode的?》
> http://www.livejournal.com/users/hongqn/4549.html
唔,很好的文章
我的debian, gentoo都是1114111
win32是65535
不过我的win32下的wxpython + wxwindow_unicode工作也是正常的


--
I'm the one, powered by nEO

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 18:16

Leo Jay python.leojay at gmail.com
Wed Sep 28 18:16:26 HKT 2005

去装了一个输入法,现在可以输中文了。

哪位兄弟知道怎么解决的,吱一声呀。 :)


--
Best Regards,
Leo Jay

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 18:18

杨军 yangjun_yulin at 126.com
Wed Sep 28 18:18:15 HKT 2005

  我现在用的是Workrave ,感觉也不错,有兴趣的可以试试。
http://www.workrave.org/welcome/

	

======= 2005-09-28 09:31:45 您在来信中写道:=======

>好!!咔咔咔!
>收录!
>http://wiki.woodpecker.org.cn/moin/MicroProj/2005-09-28
>
>大家继续讨论哪…………
>
>在 05-9-27,Kai<kai0001 at 163.com> 写道:
>> 为了避免连续长时间看电脑,能让可怜的眼睛休息一下,我凑合出这个python程序(完全新手啊,汗,大伙给改改。而且还缺少unix上的播放命令)。
>>
>> 每次一开机,我就让它一直运行,每过60分钟,它就随机选一首曲子播放,提醒歇会,看个三级写真照片什么的。
>>
>> #!/usr/bin/python
>> # -*- coding: gb2312 -*-
>>
>> import sys
>> import time
>> import random
>> import os
>>
>> directory = 'c:\\downloads\\music'  # 歌曲文件夹
>>
>> def play_soundfile(filename):  # 启动播放器
>>     if sys.platform == 'win32':
>>         import win32api
>>         win32api.ShellExecute(0, "open", filename, None, "", 0)
>>     else:
>>         print "some *nix commands here to play a sound file" # 需要加上在unix 上播放的命令
>>
>> fileList =  [os.path.join(directory, os.path.normcase(f)) for f in os.listdir(directory)]  # get a list of all music files
>>
>> while 1:
>>     print "--------------------------------------"
>>
>>     fileName = random.choice(fileList)
>>     print fileName
>>
>>     play_soundfile(fileName)
>>
>>     time.sleep(1800)
>>     print '30 minutes have passed. ', time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime())
>>     time.sleep(1800)
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> python-chinese list
>> python-chinese at lists.python.cn
>> http://python.cn/mailman/listinfo/python-chinese
>>
>>
>>
>
>
>--
>[Time is unimportant, only life important!]
>_______________________________________________
>python-chinese list
>python-chinese at lists.python.cn
>http://python.cn/mailman/listinfo/python-chinese
>

= = = = = = = = = = = = = = = = = = = =
			

        致
礼!
 
				 
        杨军
        yangjun_yulin at 126.com
          2005-09-28


[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 18:23

Qiangning Hong hongqn at gmail.com
Wed Sep 28 18:23:17 HKT 2005

Leo Jay wrote:
> 去装了一个输入法,现在可以输中文了。
> 
> 哪位兄弟知道怎么解决的,吱一声呀。 :)

你没有收到我的回贴?重新编译python,加上UCS4支持。


-- 
Qiangning Hong
http://www.hn.org/hongqn (RSS: http://feeds.feedburner.com/hongqn)

Registered Linux User #396996
Get Firefox! <http://www.spreadfirefox.com/?q=affiliates&id;=67907&t;=1>
Thunderbird! <http://www.spreadfirefox.com/?q=affiliates&id;=67907&t;=183>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 19:10

Leo Jay python.leojay at gmail.com
Wed Sep 28 19:10:57 HKT 2005

On 9/28/05, Qiangning Hong <hongqn at gmail.com> wrote:
> 你没有收到我的回贴?重新编译python,加上UCS4支持。

没收到


加上ucs4的话,
configure可以,但是make不通过了。
说是can't locate tcl/tk libs and/or headers
tcl/tk是什么?好象分别是两个软件,都要装的吗?

--
Best Regards,
Leo Jay

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 19:13

Leo Jay python.leojay at gmail.com
Wed Sep 28 19:13:10 HKT 2005

不对呀,redhat as 4本身就带了tcl8.4.7和tk8.4.7了呀.还要什么?

--
Best Regards,
Leo Jay

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 21:08

Qiangning Hong hongqn at gmail.com
Wed Sep 28 21:08:59 HKT 2005

Leo Jay wrote:
> 不对呀,redhat as 4本身就带了tcl8.4.7和tk8.4.7了呀.还要什么?

是需要tcl和tk的dev包吧,提供库和头文件。或许叫做tcl-dev、tk-dev。

...还是debian和gentoo好,不用头疼这许多复杂的依赖关系...

-- 
Qiangning Hong
http://www.hn.org/hongqn (RSS: http://feeds.feedburner.com/hongqn)

Registered Linux User #396996
Get Firefox! <http://www.spreadfirefox.com/?q=affiliates&id;=67907&t;=1>
Thunderbird! <http://www.spreadfirefox.com/?q=affiliates&id;=67907&t;=183>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2005年09月28日 星期三 22:14

Leo Jay python.leojay at gmail.com
Wed Sep 28 22:14:14 HKT 2005

On 9/28/05, Qiangning Hong <hongqn at gmail.com> wrote:
>
> 是需要tcl和tk的dev包吧,提供库和头文件。或许叫做tcl-dev、tk-dev。
>
> ...还是debian和gentoo好,不用头疼这许多复杂的依赖关系...
>

不知到为什么,刚才又试着make了一边,竟然好了.呵呵。

谢谢楼上两位了。

--
Best Regards,
Leo Jay

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号