question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bus Error 10 on Apple Silicon compiled for python 3.8

See original GitHub issue

Describe the bug

When building from source for python3.8 on an Apple Silicon Mac, the build succeeds, but you can’t import sklearn in python

Steps/Code to Reproduce

Follow directions here: https://scikit-learn.org/stable/developers/advanced_installation.html

Install libomp via brew: brew install libomp

Set libomp flags per openmp_helpers.py:

export LDFLAGS="$LDFLAGS -Wl,-rpath,/opt/homebrew/lib/ -L/usr/local/opt/libomp/lib -lomp"

export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp"

Build succeeds but testing gives the error:

Successfully installed scikit-learn
Removed build tracker: '/private/var/folders/lp/ytqhb2lj0sxf89sdd16z61pc0000gn/T/pip-req-tracker-ja_3b66l'
(tfmac) bash-3.2$ python3 -c "import sklearn; sklearn.show_versions()"
Bus error: 10
(tfmac) bash-3.2$ 

Expected Results

python3 -c “import sklearn; sklearn.show_versions()” works correctly

Actual Results

Successfully installed scikit-learn
Removed build tracker: '/private/var/folders/lp/ytqhb2lj0sxf89sdd16z61pc0000gn/T/pip-req-tracker-ja_3b66l'
(tfmac) bash-3.2$ python3 -c "import sklearn; sklearn.show_versions()"
Bus error: 10
(tfmac) bash-3.2$ 

Versions

scipy.version.version ‘1.7.0.dev0+9b9f2e8’ numpy.version.version ‘1.18.5’ Full log of install process here: https://pastebin.com/4yXK6KHS

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
iRonJcommented, Jan 7, 2021

@iRonJ how did you install python3 with homebrew? With or without arch -x86_64?

Can you please report the output of the following command on your machine?

python3 -c "import platform; print(platform.platform())"

(tfmac) bash-3.2$ python3 -c “import platform; print(platform.platform())” macOS-11.1-arm64-arm-64bit

0reactions
ogriselcommented, Jan 8, 2021

I opened https://github.com/scikit-learn/scikit-learn/issues/19137 to track progress for this. Let’s close this issue to keep things simple.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's Bus error 10 and how to solve it - Apple Community
When I'm trying to run an script in my Mac which I get bus error 10, I opened console and search for turn...
Read more >
TensorFlow on Apple M1 with 27130 bus error python
I'm having error on the TensorFlow example given here: https://www.tensorflow.org/tutorials/quickstart/beginner with setup given here: ...
Read more >
Please support tensorflow-text-macos - Apple Developer
I tried to revert my tensorflow-macos to 2.9, but when I work with it, it throws an error "zsh: bus error". It's not...
Read more >
Apple Silicon | Apple Developer Forums
Question: Is AirPlay supported for iOS apps running on apple silicon? ... Code 10 Bus error: 10 Terminating Process: exc handler [99567] VM...
Read more >
Swift "Bus error: 10" | Apple Developer Forums
Google search reports Bus error: 10 is due to memory addressing error. However, there is nothing within Swift that lets me manipulate addresses...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found