I'm having the same issue when running Python 3.6.8 on macOS Big Sur 11.4 (20F71). Installed fine with no errors, but getting the same exception when importing pyautogui
.
However, I tried installing and running with Python 3.8.8 had no problems.
I was getting errors when attempting to pip3 install pyautogui
previously, and had to fiddle with it until everything said it installed successfully. To be sure it wasn't some issue with my python environment, i created a new venv for 3.6 and got the same issues. Specifically, it seems to be choking when attempting to install pyobj
. All my software is current as I just updated everything a few says ago. Current XCode version is 12.5, build 12E262
clang -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -L/usr/local/lib -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/lpettit/Desktop/Luke/venv/include -I/usr/local/Cellar/python@3.6.8/3.6.8_5/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c Modules/objc/module.m -o build/temp.macosx-11-x86_64-3.6/Modules/objc/module.o -g -fexceptions -Wall -Wstrict-prototypes -Wmissing-prototypes -Wformat=2 -W -Wpointer-arith -Wmissing-declarations -Wnested-externs -W -Wno-import -Wno-unknown-pragmas -Wshorten-64-to-32 -Werror -I/usr/include/ffi -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -DPyObjC_BUILD_RELEASE=1103
clang: error: argument unused during compilation: '-L/usr/local/lib' [-Werror,-Wunused-command-line-argument]
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/lpettit/Desktop/Luke/venv/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/zm/vmrhx84s2033swkpff49kn_40000gn/T/pip-install-deunlwzj/pyobjc-core_d8cfbbc58c52474aa7935601a9dd5cd8/setup.py'"'"'; __file__='"'"'/private/var/folders/zm/vmrhx84s2033swkpff49kn_40000gn/T/pip-install-deunlwzj/pyobjc-core_d8cfbbc58c52474aa7935601a9dd5cd8/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/zm/vmrhx84s2033swkpff49kn_40000gn/T/pip-record-5iunioef/install-record.txt --single-version-externally-managed --compile --install-headers /Users/lpettit/Desktop/Luke/venv/include/site/python3.6/pyobjc-core Check the logs for full command output.
I'd suggest to migrate to python3.8 or 3.9 if possible. I'm not 100% convinced that the xcode version is really the problem and not just a symptom, but you could try and rollback your c compiler version and see if it helps.