[ ] if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?
What you were trying to do (and why)
I'm running macOS Catalina on no longer supported hardware (a MacBook Pro Mid 2009 MacBookPro5,5) using macOS Catalina Patcher.
When I try to install python@3.8 the post install steps fail and every time I try to run python3.8 it crashes with an illegal hardware instruction message.
When I try to compile it myself with brew reinstall python@3.8 --build-from-source the compile process also fails with a similar illegal instruction message.
What happened (include command output)
Command output
```
user@Users-MBP ~ % brew install python@3.8
==> Downloading https://homebrew.bintray.com/bottles/python@3.8-3.8.1.catalina.bottle.tar.gz
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/2d83eddd6e3c5cf8943d9c7e346e971b712f091ab54703569c17deeab7e7468a--python@3.8-3.8.1.catalina.bottle.tar.gz
==> Pouring python@3.8-3.8.1.catalina.bottle.tar.gz
==> /usr/local/Cellar/python@3.8/3.8.1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python@3.8/3.8.1/bin --install-lib=/usr/lo
Last 15 lines from /Users/user/Library/Logs/Homebrew/python@3.8/post_install.01.python3:
2020-02-18 20:08:01 +0100
/usr/local/Cellar/python@3.8/3.8.1/bin/python3
-s
setup.py
--no-user-cfg
install
--force
--verbose
--install-scripts=/usr/local/Cellar/python@3.8/3.8.1/bin
--install-lib=/usr/local/lib/python3.8/site-packages
--single-version-externally-managed
--record=installed.txt
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall python@3.8`
==> Caveats
Python has been installed as
/usr/local/opt/python@3.8/bin/python3
You can install Python packages with
/usr/local/opt/python@3.8/bin/pip3 install
They will install into the site-package directory
/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
See: https://docs.brew.sh/Homebrew-and-Python
python@3.8 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have python@3.8 first in your PATH run:
echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.zshrc
For compilers to find python@3.8 you may need to set:
export LDFLAGS="-L/usr/local/opt/python@3.8/lib"
For pkg-config to find python@3.8 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/python@3.8/lib/pkgconfig"
==> Summary
🍺 /usr/local/Cellar/python@3.8/3.8.1: 3,406 files, 53.7MB
user@Users-MBP ~ % /usr/local/Cellar/python@3.8/3.8.1/bin/python3 --version
zsh: illegal hardware instruction /usr/local/Cellar/python@3.8/3.8.1/bin/python3 --version
user@Users-MBP ~ % brew reinstall python@3.8 --build-from-source
==> Reinstalling python@3.8
==> Downloading https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tar.xz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/python@3.8/3.8.1 --enable-ipv6 --datarootdir=/usr/local/Cellar/python@3.8/3.8.1/share --datadir=/usr/local/Cellar/python@3.8/3.8.1/share -
==> make
Last 15 lines from /Users/user/Library/Logs/Homebrew/python@3.8/02.make:
Python.framework/Versions/3.8/Resources/Info.plist
ln -fsn 3.8 Python.framework/Versions/Current
ln -fsn Versions/Current/Python Python.framework/Python
ln -fsn Versions/Current/Resources Python.framework/Resources
clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-stack_size,1000000 -framework CoreFoundation Python.framework/Versions/3.8/Python -o python.exe Programs/python.o -ldl -framework CoreFoundation
clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-stack_size,1000000 -framework CoreFoundation Python.framework/Versions/3.8/Python -o Programs/_testembed Programs/_testembed.o -ldl -framework CoreFoundation
DYLD_FRAMEWORK_PATH=/private/tmp/python@3.8-20200218-3776-wz4ob2/Python-3.8.1 ./python.exe -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
/bin/sh: line 1: 11970 Illegal instruction: 4 DYLD_FRAMEWORK_PATH=/private/tmp/python@3.8-20200218-3776-wz4ob2/Python-3.8.1 ./python.exe -E -S -m sysconfig --generate-posix-vars
generate-posix-vars failed
make: *** [pybuilddir.txt] Error 1
```
Every time I get an illegal instruction message in the terminal, macOS shows an error dialog popup with a more detail exception description:
I googled around a bit and the missing CPU feature probably is AVX (Advanced Vector Extensions) when people get an illegal instruction error while using python. My CPU doesn't have this feature:
% sysctl -a | grep -i features
machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 DTES64 MON DSCPL VMX EST TM2 SSSE3 CX16 TPR PDCM SSE4.1 XSAVE
machdep.cpu.extfeatures: SYSCALL XD EM64T LAHF
I wouldn't be opening this issue, if python3 (3.7) would show the same error. But the python3 formula works fine on this old MacBook and I can also compile it without errors.
MacPorts can successfully install python 3.8 and it runs without problems. But I would really rather use brew instead.
This all leads me to the conclusion that it's something in the python@3.8 formula.
What you expected to happen
I expected to be able to compile python@3.8 myself and then being able to run it without the missing CPU features successfully.
Even better would be to have the binary not using the missing instructions, but I see the point of my old hardware holding back everybody else.
In the next snippet you can see all my executed commands with their respective output. I also included some more system info.
All executed commands
```
Last login: Tue Feb 18 17:58:36 on console
user@Users-MBP ~ % brew update
Updated 1 tap (homebrew/core).
==> Updated Formulae
antlr@2 gatsby-cli grpc itex2mml mat2 nco pyenv-virtualenv tomcat@7
azure-cli gnu-getopt gtk+3 jack mlt open-scene-graph tcl-tk tox
dartsim golang-migrate ipython mariadb-connector-c mpd platformio terragrunt tundra
==> Deleted Formulae
zpython
user@Users-MBP ~ % brew update
Already up-to-date.
user@Users-MBP ~ % brew install python@3.8
==> Downloading https://homebrew.bintray.com/bottles/python@3.8-3.8.1.catalina.bottle.tar.gz
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/2d83eddd6e3c5cf8943d9c7e346e971b712f091ab54703569c17deeab7e7468a--python@3.8-3.8.1.catalina.bottle.tar.gz
==> Pouring python@3.8-3.8.1.catalina.bottle.tar.gz
==> /usr/local/Cellar/python@3.8/3.8.1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python@3.8/3.8.1/bin --install-lib=/usr/lo
Last 15 lines from /Users/user/Library/Logs/Homebrew/python@3.8/post_install.01.python3:
2020-02-18 20:08:01 +0100
/usr/local/Cellar/python@3.8/3.8.1/bin/python3
-s
setup.py
--no-user-cfg
install
--force
--verbose
--install-scripts=/usr/local/Cellar/python@3.8/3.8.1/bin
--install-lib=/usr/local/lib/python3.8/site-packages
--single-version-externally-managed
--record=installed.txt
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall python@3.8`
==> Caveats
Python has been installed as
/usr/local/opt/python@3.8/bin/python3
You can install Python packages with
/usr/local/opt/python@3.8/bin/pip3 install
They will install into the site-package directory
/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
See: https://docs.brew.sh/Homebrew-and-Python
python@3.8 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have python@3.8 first in your PATH run:
echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.zshrc
For compilers to find python@3.8 you may need to set:
export LDFLAGS="-L/usr/local/opt/python@3.8/lib"
For pkg-config to find python@3.8 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/python@3.8/lib/pkgconfig"
==> Summary
🍺 /usr/local/Cellar/python@3.8/3.8.1: 3,406 files, 53.7MB
user@Users-MBP ~ % /usr/local/Cellar/python@3.8/3.8.1/bin/python3 --version
zsh: illegal hardware instruction /usr/local/Cellar/python@3.8/3.8.1/bin/python3 --version
user@Users-MBP ~ % brew reinstall python@3.8 --build-from-source
==> Reinstalling python@3.8
==> Downloading https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tar.xz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/python@3.8/3.8.1 --enable-ipv6 --datarootdir=/usr/local/Cellar/python@3.8/3.8.1/share --datadir=/usr/local/Cellar/python@3.8/3.8.1/share -
==> make
Last 15 lines from /Users/user/Library/Logs/Homebrew/python@3.8/02.make:
Python.framework/Versions/3.8/Resources/Info.plist
ln -fsn 3.8 Python.framework/Versions/Current
ln -fsn Versions/Current/Python Python.framework/Python
ln -fsn Versions/Current/Resources Python.framework/Resources
clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-stack_size,1000000 -framework CoreFoundation Python.framework/Versions/3.8/Python -o python.exe Programs/python.o -ldl -framework CoreFoundation
clang -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-stack_size,1000000 -framework CoreFoundation Python.framework/Versions/3.8/Python -o Programs/_testembed Programs/_testembed.o -ldl -framework CoreFoundation
DYLD_FRAMEWORK_PATH=/private/tmp/python@3.8-20200218-3776-wz4ob2/Python-3.8.1 ./python.exe -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
/bin/sh: line 1: 11970 Illegal instruction: 4 DYLD_FRAMEWORK_PATH=/private/tmp/python@3.8-20200218-3776-wz4ob2/Python-3.8.1 ./python.exe -E -S -m sysconfig --generate-posix-vars
generate-posix-vars failed
make: *** [pybuilddir.txt] Error 1
READ THIS: https://docs.brew.sh/Troubleshooting
These open issues may also help:
subversion: use python@3.8 https://github.com/Homebrew/homebrew-core/pull/50391
Python 3.8 migration https://github.com/Homebrew/homebrew-core/issues/47274
ansible: fix python@3.8 warnings https://github.com/Homebrew/homebrew-core/pull/49083
Python 3.8: Migrate connected formulae https://github.com/Homebrew/homebrew-core/pull/47326
user@Users-MBP ~ % brew doctor
Your system is ready to brew.
user@Users-MBP ~ % sysctl -a | grep -i features
machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 DTES64 MON DSCPL VMX EST TM2 SSSE3 CX16 TPR PDCM SSE4.1 XSAVE
machdep.cpu.extfeatures: SYSCALL XD EM64T LAHF
user@Users-MBP ~ % uname -a
Darwin Users-MBP.fritz.box 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64
user@Users-MBP ~ % system_profiler SPHardwareDataType
Hardware:
Hardware Overview:
Model Name: MacBook Pro
Model Identifier: MacBookPro5,5
Processor Name: Intel Core 2 Duo
Processor Speed: 2,26 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache: 3 MB
Memory: 8 GB
Boot ROM Version: MBP55.00AC.B03
SMC Version (system): 1.47f2
Serial Number (system): x
Hardware UUID: x
Sudden Motion Sensor:
State: Enabled
user@Users-MBP ~ % system_profiler SPSoftwareDataType
Software:
System Software Overview:
System Version: macOS 10.15.3 (19D76)
Kernel Version: Darwin 19.3.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Computer Name: x
User Name: x
Secure Virtual Memory: Enabled
System Integrity Protection: Disabled
Time since boot: 2:24
user@Users-MBP ~ %
```
brew update
and can still reproduce the problem?brew doctor
, fixed all issues and can still reproduce the problem?brew gist-logs <formula>
(where<formula>
is the name of the formula that failed) and included the output link? https://gist.github.com/StareInTheAir/757692d7bfa4e1acfcd23c79a68d9b1dbrew gist-logs
didn't work: ranbrew config
andbrew doctor
and included their output with your issue?What you were trying to do (and why)
I'm running macOS Catalina on no longer supported hardware (a MacBook Pro Mid 2009 MacBookPro5,5) using macOS Catalina Patcher.
When I try to install
python@3.8
the post install steps fail and every time I try to run python3.8 it crashes with anillegal hardware instruction
message.When I try to compile it myself with
brew reinstall python@3.8 --build-from-source
the compile process also fails with a similar illegal instruction message.What happened (include command output)
Command output
``` user@Users-MBP ~ % brew install python@3.8 ==> Downloading https://homebrew.bintray.com/bottles/python@3.8-3.8.1.catalina.bottle.tar.gz Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/2d83eddd6e3c5cf8943d9c7e346e971b712f091ab54703569c17deeab7e7468a--python@3.8-3.8.1.catalina.bottle.tar.gz ==> Pouring python@3.8-3.8.1.catalina.bottle.tar.gz ==> /usr/local/Cellar/python@3.8/3.8.1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python@3.8/3.8.1/bin --install-lib=/usr/lo Last 15 lines from /Users/user/Library/Logs/Homebrew/python@3.8/post_install.01.python3: 2020-02-18 20:08:01 +0100 /usr/local/Cellar/python@3.8/3.8.1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python@3.8/3.8.1/bin --install-lib=/usr/local/lib/python3.8/site-packages --single-version-externally-managed --record=installed.txt Warning: The post-install step did not complete successfully You can try again using `brew postinstall python@3.8` ==> Caveats Python has been installed as /usr/local/opt/python@3.8/bin/python3 You can install Python packages with /usr/local/opt/python@3.8/bin/pip3 installEvery time I get an illegal instruction message in the terminal, macOS shows an error dialog popup with a more detail exception description:
macOS error dialog message
``` Process: Python [3377] Path: /usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/Resources/Python.app/Contents/MacOS/Python Identifier: Python Version: 3.8.1 (3.8.1) Code Type: X86-64 (Native) Parent Process: ruby [3367] Responsible: Terminal [612] User ID: 501 Date/Time: 2020-02-18 20:08:02.259 +0100 OS Version: Mac OS X 10.15.3 (19D76) Report Version: 12 Anonymous UUID: 0223418D-E6B6-3B8D-C725-30B0165DBA77 Sleep/Wake UUID: 248BF907-9392-45EC-A04A-190CB9070E31 Time Awake Since Boot: 1600 seconds Time Since Wake: 180 seconds System Integrity Protection: disabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_INSTRUCTION (SIGILL) Exception Codes: 0x0000000000000001, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Illegal instruction: 4 Termination Reason: Namespace SIGNAL, Code 0x4 Terminating Process: exc handler [3377] Application Specific Information: dyld2 mode Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 org.python.python 0x0000000100ae43d8 PyConfig_Read + 1607 1 org.python.python 0x0000000100aefbd1 Py_InitializeFromConfig + 360 2 org.python.python 0x0000000100b0b92d pymain_main + 235 3 org.python.python 0x0000000100b0b9c2 Py_BytesMain + 42 4 libdyld.dylib 0x00007fff706137fd start + 1 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000001 rbx: 0x00007ffeef1f9e40 rcx: 0x000000000000002e rdx: 0x00007fac5bd017c0 rdi: 0x0000000000000000 rsi: 0x0000000000000000 rbp: 0x00007ffeef1f9e90 rsp: 0x00007ffeef1f9d50 r8: 0x000000000000002e r9: 0x00007ffeef1faee9 r10: 0x00007ffeef1faee8 r11: 0x8080808080808080 r12: 0x0000000000000000 r13: 0x00007ffeef1f9ea0 r14: 0x0000000000000000 r15: 0x0000000000000000 rip: 0x0000000100ae43d8 rfl: 0x0000000000010246 cr2: 0x0000000100b6cc16 Logical CPU: 0 Error Code: 0x00000000 Trap Number: 6 Binary Images: 0x100a05000 - 0x100a06fff +org.python.python (3.8.1 - 3.8.1) <4BAB9CE0-31BD-3CFD-A6A1-DDCC0F7578BB> /usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/Resources/Python.app/Contents/MacOS/Python 0x100a0e000 - 0x100be0fff +org.python.python (3.8.1, [c] 2001-2019 Python Software Foundation. - 3.8.1) <0004A129-E7AF-3741-9894-0F128FF8CA89> /usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/Python 0x107353000 - 0x1073e3cb7 dyld (733.8)I googled around a bit and the missing CPU feature probably is AVX (Advanced Vector Extensions) when people get an illegal instruction error while using python. My CPU doesn't have this feature:
I wouldn't be opening this issue, if python3 (3.7) would show the same error. But the
python3
formula works fine on this old MacBook and I can also compile it without errors. MacPorts can successfully install python 3.8 and it runs without problems. But I would really rather use brew instead. This all leads me to the conclusion that it's something in thepython@3.8
formula.What you expected to happen
I expected to be able to compile
python@3.8
myself and then being able to run it without the missing CPU features successfully.Even better would be to have the binary not using the missing instructions, but I see the point of my old hardware holding back everybody else.
Step-by-step reproduction instructions (by running
brew install
commands)In the next snippet you can see all my executed commands with their respective output. I also included some more system info.
All executed commands
``` Last login: Tue Feb 18 17:58:36 on console user@Users-MBP ~ % brew update Updated 1 tap (homebrew/core). ==> Updated Formulae antlr@2 gatsby-cli grpc itex2mml mat2 nco pyenv-virtualenv tomcat@7 azure-cli gnu-getopt gtk+3 jack mlt open-scene-graph tcl-tk tox dartsim golang-migrate ipython mariadb-connector-c mpd platformio terragrunt tundra ==> Deleted Formulae zpython user@Users-MBP ~ % brew update Already up-to-date. user@Users-MBP ~ % brew install python@3.8 ==> Downloading https://homebrew.bintray.com/bottles/python@3.8-3.8.1.catalina.bottle.tar.gz Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/2d83eddd6e3c5cf8943d9c7e346e971b712f091ab54703569c17deeab7e7468a--python@3.8-3.8.1.catalina.bottle.tar.gz ==> Pouring python@3.8-3.8.1.catalina.bottle.tar.gz ==> /usr/local/Cellar/python@3.8/3.8.1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python@3.8/3.8.1/bin --install-lib=/usr/lo Last 15 lines from /Users/user/Library/Logs/Homebrew/python@3.8/post_install.01.python3: 2020-02-18 20:08:01 +0100 /usr/local/Cellar/python@3.8/3.8.1/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python@3.8/3.8.1/bin --install-lib=/usr/local/lib/python3.8/site-packages --single-version-externally-managed --record=installed.txt Warning: The post-install step did not complete successfully You can try again using `brew postinstall python@3.8` ==> Caveats Python has been installed as /usr/local/opt/python@3.8/bin/python3 You can install Python packages with /usr/local/opt/python@3.8/bin/pip3 install