Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

python target is not used on M1 #979

Closed
1 of 2 tasks
twiecki opened this issue Jun 21, 2022 · 5 comments 路 Fixed by #980
Closed
1 of 2 tasks

python target is not used on M1 #979

twiecki opened this issue Jun 21, 2022 · 5 comments 路 Fixed by #980
Labels
bug Something isn't working

Comments

@twiecki
Copy link

twiecki commented Jun 21, 2022

Bug Description

>>maturin develop
馃嵐 Building a mixed python/rust project
馃敆 Found pyo3 bindings
馃悕 Found CPython 3.10 at /Users/twiecki/miniforge3/envs/pymc4/bin/python
馃摗 Using build options bindings from pyproject.toml
   Compiling autocfg v1.1.0
   Compiling cfg-if v1.0.0
   Compiling once_cell v1.12.0
   Compiling libc v0.2.126
   Compiling proc-macro2 v1.0.39
   Compiling target-lexicon v0.12.4
   Compiling unicode-ident v1.0.1
   Compiling syn v1.0.96
   Compiling scopeguard v1.1.0
   Compiling crossbeam-utils v0.8.9
   Compiling libm v0.2.2
   Compiling parking_lot_core v0.9.3
   Compiling rayon-core v1.9.3
   Compiling ppv-lite86 v0.2.16
   Compiling smallvec v1.8.0
   Compiling crossbeam-queue v0.3.5
   Compiling rawpointer v0.2.1
   Compiling either v1.6.1
   Compiling unindent v0.1.9
   Compiling indoc v1.0.6
   Compiling num-traits v0.2.15
   Compiling memoffset v0.6.5
   Compiling crossbeam-epoch v0.9.9
   Compiling lock_api v0.4.7
   Compiling num-integer v0.1.45
   Compiling rayon v1.5.3
   Compiling matrixmultiply v0.3.2
   Compiling itertools v0.10.3
   Compiling getrandom v0.2.7
   Compiling num_cpus v1.13.1
   Compiling rand_core v0.6.3
   Compiling quote v1.0.18
   Compiling crossbeam-channel v0.5.5
   Compiling pyo3-build-config v0.16.5
   Compiling parking_lot v0.12.1
   Compiling rand_chacha v0.3.1
   Compiling crossbeam-deque v0.8.1
   Compiling crossbeam v0.8.1
   Compiling rand v0.8.5
   Compiling num-complex v0.4.1
   Compiling ndarray v0.15.4
   Compiling rand_distr v0.4.3
   Compiling pyo3-ffi v0.16.5
   Compiling pyo3 v0.16.5
   Compiling pyo3-macros-backend v0.16.5
   Compiling thiserror-impl v1.0.31
   Compiling multiversion-macros v0.6.1
   Compiling pyo3-macros v0.16.5
   Compiling multiversion v0.6.1
   Compiling thiserror v1.0.31
   Compiling nuts-rs v0.2.0
   Compiling numpy v0.16.2
   Compiling nutpie v0.1.0 (/Users/twiecki/projects/nutpie)
    Finished dev [unoptimized + debuginfo] target(s) in 20.92s
馃摝 Built wheel for CPython 3.10 to /var/folders/mn/0x4pxw0n61lf479ndp07r0gr0000gn/T/.tmpXjpvDA/nutpie-0.1.0-cp310-cp310-macosx_10_7_x86_64.whl
馃挜 maturin failed
  Caused by: pip install in /Users/twiecki/miniforge3/envs/pymc4 failed running ["-m", "pip", "--disable-pip-version-check", "install", "--force-reinstall", "/var/folders/mn/0x4pxw0n61lf479ndp07r0gr0000gn/T/.tmpXjpvDA/nutpie-0.1.0-cp310-cp310-macosx_10_7_x86_64.whl"]: exit status: 1
--- Stdout:

--- Stderr:
ERROR: nutpie-0.1.0-cp310-cp310-macosx_10_7_x86_64.whl is not a supported wheel on this platform.
---

>>/Users/twiecki/miniforge3/envs/pymc4/bin/python -c 'import sysconfig; print(sysconfig.get_platform())'
macosx-11.0-arm64

It seems to instead use this one:

>>which python
python is /Users/twiecki/miniforge3/envs/pymc4/bin/python
python is /usr/local/bin/python
(pymc4) --(12:20:44)--(MacBook-Air-4)--(~/projects/nutpie     )--(master)
>>/usr/local/bin/python -c 'import sysconfig; print(sysconfig.get_platform())'
macosx-10.13-x86_64

But I can't see where it's it setting from.

Your Python version (python -V)

Python 3.10.4

Your pip version (pip -V)

pip 22.1.2 from /Users/twiecki/miniforge3/envs/pymc4/lib/python3.10/site-packages/pip (python 3.10)

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  1. Use M1
  2. Run maturin develop
@twiecki twiecki added the bug Something isn't working label Jun 21, 2022
@messense
Copy link
Member

I think you installed x86_64 Rust by default, can you run rustc -vV and paste the output here?

@twiecki
Copy link
Author

twiecki commented Jun 21, 2022

>>rustc -vV
rustc 1.59.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-apple-darwin
release: 1.59.0
LLVM version: 13.0.0

@messense
Copy link
Member

host: x86_64-apple-darwin

Yup, reinstall your Rust toolchain and make sure it outputs host: aarch64-apple-darwin should resolve your issue.

@messense
Copy link
Member

Although we should be able to detect the arm64 Python and use --target aarch64-apple-darwin automatically in maturin, so I'll keep this issue open for now.

@twiecki
Copy link
Author

twiecki commented Jun 21, 2022

That fixed it -- thanks! I had to reinstall homebrew.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants