Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Macintosh Python: 64-bit vs 32-bit problems

Tags:

python

I'm trying to sort through a whole host of problems arising from upgrading my macintosh to 10.6. Most of the tools I need work, but a couple (scipy, wxpython) do not, and give error messages that are highly suggestive of my messing up something with 64-bit and 32-bit binaries.

I'm currently running Python 2.7. I don't know whether it is a 32-bit or a 64-bit version. How do I tell?

What I'm most concerned about is that I have some bizarre mixture of 32-bit and 64-bit, and that I should scrap everything and reinstall. If I do this, and I want to avoid as many build problems as possible, do I (1) install the 32-bit version, (2) install the 64-bit version and make sure everything I build is 64-bit enabled, or (3) something else.

I've tried without luck to find web pages regarding this, since other people must have stumbled over these issue, but I apologize if I'm rehashing old issues here. I've also tried very hard not to type the offensive statement "I don't care about 32-bit vs 64-bit, I just want Python to work", but, in effect, that's what I'm asking here.

Heaps of gratitude to whomever can help me sort through this, and apologies if I'm just being dense.

like image 790
Rick Avatar asked Apr 18 '26 05:04

Rick


1 Answers

For wxPython, try using this shebang as the first line of your script:

#!/usr/bin/arch -arch i386 python2.7

Or running from the command line with

arch -arch i386 python2.7 yourScript.py

Basically, your python executable should include both 32-bit and 64-bit versions, and the 'arch' command tells the system which one to run with.

like image 110
Russell Borogove Avatar answered Apr 24 '26 17:04

Russell Borogove



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!