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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install on MacOS ARM64 #7

Open
neonelemental opened this issue Jan 29, 2024 · 2 comments
Open

Unable to install on MacOS ARM64 #7

neonelemental opened this issue Jan 29, 2024 · 2 comments

Comments

@neonelemental
Copy link

neonelemental commented Jan 29, 2024

Hey there. I'm attempting to follow the instructions for building sagepy using the README, and I've unfortunately hit a snag. I have gotten as far as building the wheel with maturin, however once I install the wheel and attempt to run poetry install, I get an error. Here's my terminal output:

# Setup venv
python -m venv venv
source venv/bin/activate

# Setup the build dependencies
pip install --upgrade pip
pip install poetry
pip install maturin

# Build and install the bindings
maturin build --release --manifest-path sagepy-connector/Cargo.toml
pip install sagepy-connector/target/wheels/sagepy_connector-0.2.6-cp310-cp310-macosx_11_0_arm64.whl

# Attempt to install sagepy library
poetry install --directory sagepy

Here's the output from running that command:

Updating dependencies
Resolving dependencies... (0.2s)

Package operations: 0 installs, 1 update, 0 removals

  • Updating sagepy-connector (0.2.6 /Users/mike/code/sagepy/sagepy/sagepy-connector/target/wheels/sagepy_connector-0.2.6-cp310-cp310-macosx_11_0_arm64.whl -> 0.2.6): Failed

  RuntimeError

  Unable to find installation candidates for sagepy-connector (0.2.6)

  at ~/code/sagepy/venv/lib/python3.10/site-packages/poetry/installation/chooser.py:73 in choose_for
       69│
       70│             links.append(link)
       71│
       72│         if not links:
    →  73│             raise RuntimeError(f"Unable to find installation candidates for {package}")
       74│
       75│         # Get the best link
       76│         chosen = max(links, key=lambda link: self._sort_key(package, link))
       77│

Cannot install sagepy-connector.

I have followed the instructions to a T (as in, run the exact commands rather than the ones I wrote above), but I get the exact same result, looks like poetry doesn't know how to work with the installed wheel.

I am probably doing something dumb, but I figured I'd reach out while I continue getting this setup.

@neonelemental
Copy link
Author

I was able to work around this issue by specifying { file = "/path/to/wheel.whl" } in the pyproject.toml. Not a great solution but at least I can move forward for the time being.

@theGreatHerrLebert
Copy link
Owner

Hi there,

Thank you for reaching out and detailing the issue you've encountered while setting up sagepy.

Unfortunately, the documentation hasn't been fully updated to the latest development changes. We recently made the package available on PyPI, which has led to some discrepancies in the installation process, especially for users with Apple's M chips.

The core of the problem you're facing is likely related to GitHub Actions, which currently doesn't support building binaries for Apple's M chips (only older Intel). Consequently, when you run poetry install --directory sagepy, it's likely pulling the sagepy-connector dependency binary from PyPI that was built for the older Intel chips. This mismatch could be the reason behind the error you're seeing with the wheel.

While we work on a solution to support Apple's M chips, there's a workaround that you can use. After you install sagepy, please re-install the sagepy connector from your local build:

# First, install sagepy
poetry install --directory sagepy

# Then, re-install sagepy connector
pip install sagepy-connector/target/wheels/sagepy_connector-0.2.6-cp310-cp310-macosx_11_0_arm64.whl

This should resolve the issue for the time being. We are actively working on updating our build process to better support the new Apple M chips and will update the documentation accordingly. Please feel free to reach out if you have any more questions or encounter further issues.

Best,

David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants