requirement.txt installation is failing while building "orjson" on 64 bit python interpreter on 64 bit Mac OSX

2.8k Views Asked by At

Running requirements.txt installation for a project(Fast API). Ending up with below error. I have try approach from https://github.com/rust-lang/rust/issues/61925 and I have set up rust to "nightly" using rustup override set nightly still facing the error.

  Using cached orjson-3.4.3.tar.gz (1.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/[email protected]/bin/python3.8 /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/tmpwyr1rz66
         cwd: /private/var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/pip-install-qmnttz7p/orjson
    Complete output (13 lines):
     maturin failed
      Caused by: Cargo metadata failed. Do you have cargo in your PATH?
      Caused by: Error during execution of `cargo metadata`: error: failed to run `rustc` to learn about target-specific information
    
    Caused by:
      process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -Z mutable-noalias --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
      --- stderr
      error: the option `Z` is only accepted on the nightly compiler
    
    
    Checking for Rust toolchain....
    Running `maturin pep517 write-dist-info --metadata-directory /private/var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/pip-modern-metadata-c1upg8fc --interpreter /usr/local/Cellar/[email protected]/3.8.6_2/bin/python3.8 --manylinux=off --strip=on`
    Error: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/private/var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/pip-modern-metadata-c1upg8fc', '--interpreter', '/usr/local/Cellar/[email protected]/3.8.6_2/bin/python3.8', '--manylinux=off', '--strip=on']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/[email protected]/bin/python3.8 /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/tmpwyr1rz66 Check the logs for full command output.

Please advise! Thank you!

1

There are 1 best solutions below

1
Saqib Bilal On

It seems like the error is with the maturin command using "Z" option which is only applicable in nightly compiler. you can first try to install

Install nightly toolchain:

rustup install nightly

Switch to nightly toolchain as default toolchain:

rustup default nightly

and then try to install those dependencies. Hope this works!!!!