Macintosh Python: 64-bit and 32-bit issues

I am trying to solve a number of problems associated with upgrading my macintosh to 10.6. Most of the tools that I need, but a couple (scipy, wxpython) do not do this, and give error messages that very suggest that I messed up something using 64-bit and 32-bit binaries.

I am currently running Python 2.7. I do not know if this is a 32-bit or 64-bit version. How can i say

What bothers me the most is that I have some kind of weird mix of 32-bit and 64-bit, and I have to give up everything and reinstall. If I do this, and I want to avoid as many build problems as possible, do (1) install the 32-bit version, (2) install the 64-bit version and make sure that everything I build, or (3) that something else.

I tried with no luck finding web pages regarding this, as other people must have stumbled upon this problem, but I apologize if I review the old problems here. I also tried very hard not to print the offensive statement "I donโ€™t care that 32-bit and 64-bit, I just want Python to work", but, in fact, this is what I ask here.

A lot of thanks to someone who can help me figure this out, and I'm sorry if I'm just tight.

+3
source share
2 answers

I also had serious problems with the update, so you are not alone, only a little late.

To find out what type of binary code you have, the command fileis 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 else works, you can even remove it and start from scratch using Homebrew. He quickly gets to the point where hell is less hot. After that, you only need to figure out how to compile this important esoteric library into the desired architecture.

+1
source

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

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

arch -arch i386 python2.7 yourScript.py

, python 32-, 64- , "arch" , .

+1

Source: https://habr.com/ru/post/1774127/


All Articles