wxpython 不能运行在64位 mac 电脑上的解决方法

来源:互联网 发布:开淘宝网店收费吗 编辑:程序博客网 时间:2024/04/28 18:27

The problem is that WxPython is only available on the Mac in 32-bit mode; however, by default, Python will start up in 64-bit mode. To fix this problem, create the following shell script namedpython_32:

#! /bin/bashexport VERSIONER_PYTHON_PREFER_32_BIT=yes/usr/bin/python "$@"

Make the script executable (chmod a+x python_32) and place the script in your path. Now, simply invokepython_32 to get an interactive Python console in which you can use WxPython. If you want to write a Python script that uses this, you can use the shebang:#! /usr/bin/env python_32.

Now to explain... the basic problem is that 32-bit and 64-bit code uses a different application binary interface (ABI), and so 32-bit code and 64-bit code cannot coexist in the same library/executable/process. In order to support 64-bit mode, it needs to have been compiled in 64-bit mode; likewise, to support 32-bit mode, it needs to have been compiled in 32-bit mode. Under OS X, it is possible, using universal binaries to support both... however, it needs to be compiled in both modes (and then merged). WxWidgets probably uses Carbon, which is only available in 32-bit mode (Cocoa is available in both 32-bit and 64-bit mode... Apple didn't bother making Carbon available in both modes, since it is being deprecated), which would explain why WxPython, in turn, could only be provided in 32-bit mode. This, in turn, means that using it in Python requires you to launch Python in 32-bit mode (Python is a universal binary with both 32-bit and 64-bit versions of itself available in the same binary file, so it can be launched in either mode).

0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 月子8天腰背疼怎么办 生完五天腰背疼怎么办 生完孩子腰不好怎么办 养了个白眼狼怎么办 孩子学东西很慢怎么办 手不小心碰肿了怎么办 腿中间摩擦的疼怎么办 晚上睡觉时双腿酸胀怎么办 腿擦破皮了怎么办 快速好 宝宝腿擦破皮了怎么办 新生儿睡觉腿喜欢弯曲怎么办 孩子八个月交叉走路怎么办 胫椎引起双腿发热怎么办 婴儿头型睡扁了怎么办 膝盖抻筋了疼怎么办 小腿肚子抻筋了怎么办 后背抻筋了 很疼怎么办 运动膝盖抻着了怎么办 大腿内侧抻着了怎么办 大腿抻筋了 很疼怎么办 小腿肚子聚筋了怎么办 6个月婴儿腿弯怎么办 胳膊抻筋拉伤了怎么办 宝宝抻着了怎么办妙招 拎东西胳膊抻了怎么办 小臂一用力筋疼怎么办 摔破胳膊很痛怎么办 胳膊的筋扭伤了怎么办 小孩胳膊抻筋了怎么办 肩膀抻着了怎么办妙招 右边肩膀抻着了怎么办 胳膊因劳累很痛怎么办 宝宝胳膊摔了疼怎么办 宝宝胳膊抻筋了怎么办 孕妇胳膊筋伤了怎么办 刚进公司就怀孕怎么办 撞到胳膊麻筋了怎么办 腰抻了怎么办多久能好 腰突然抻了一下怎么办 干活抻筋了 很疼怎么办 胳膊抻筋一动就疼怎么办