kivy / pyobjus

Access Objective-C classes from Python
https://pyobjus.readthedocs.io
MIT License
178 stars 47 forks source link

'error: Unsupported architecture' when trying to install on Mac OS X Catalina 10.15.7 #75

Closed HeRo002 closed 2 years ago

HeRo002 commented 3 years ago

I am trying to install PyObjus on a MacBook (Mid 2012) running OS X Catalina ver. 10.15.7. In Terminal I activate my Python venv and go to the 'pyobjus-master' directory where I unpacked the zip file. Then I try:

(venv) henrik@MBPtilhdeHenrik pyobjus-master % python setup.py install   

Here is the start of the error output:

(venv) henrik@MBPtilhdeHenrik pyobjus-master % python setup.py install 
Pyobjus platform is darwin
running install
running build
running build_py
running build_ext
skipping 'pyobjus/pyobjus.c' Cython extension (up-to-date)
building 'pyobjus' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/Users/henrik/Python-Kivy/Geo-ESP/venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c pyobjus/pyobjus.c -o build/temp.macosx-10.14.6-x86_64-3.8/pyobjus/pyobjus.o
In file included from pyobjus/pyobjus.c:4:
In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/limits.h:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/limits.h:63:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
#error Unsupported architecture
 ^
In file included from pyobjus/pyobjus.c:4:
In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:11:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/limits.h:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/limits.h:64:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
#error architecture not supported
 ^

From there it's just 18 similar errors, then:

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command 'clang' failed with exit status 1

I also tried:

% python3 setup.py install

And even:

% pip3 install pyobjus

And:

% python3 setup.py install --user

Please help! Thank you!

Actually I feel that my Kivy app is important for the future of mankind...! And it can't work without exporting a data file to be opened by other apps. For that I guess I need PyObjus.

I am willing to pay someone to create a file export/share module for Python-Kivy-iOS!

HeRo002 commented 3 years ago

I managed to build PyObjus for iOS and Xcode using toolchain:

(venv) henrik@Henrik ~ % toolchain build pyobjus

I tested it by modifying https://github.com/kivy/pyobjus/blob/master/examples/using_autoclass.py and it worked - more or less. :-)