Reputation: 1814
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.
Upvotes: 3
Views: 540
Reputation: 10570
I also had major problems upgrading, so you are not alone, only a bit late.
To figure out what kind of binary you have, the file
command is your friend:
$ file /usr/local/bin/python
/usr/local/bin/python: Mach-O universal binary with 2 architectures
/usr/local/bin/python (for architecture i386): Mach-O executable i386
/usr/local/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64
You may also be advised to use MacPorts or (even better) HomeBrew.
If you are already using MacPorts and nothing works anymore, you may even want to uninstall it and start from scratch with Homebrew. It gets you quickly to a point where hell is less hot. After that you only need to figure out how to compile that important esoteric library to the right architecture.
Upvotes: 1
Reputation: 19037
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.
Upvotes: 1