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

pip install v1.1.5 fails on Mac (M1) #153

Closed
marvinschmitt opened this issue Mar 19, 2024 · 1 comment
Closed

pip install v1.1.5 fails on Mac (M1) #153

marvinschmitt opened this issue Mar 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@marvinschmitt
Copy link
Collaborator

Problem Description

After v.1.1.5, a fresh pip install bayesflow on Apple Silicon (M1) fails due to conflicting dependencies:

ERROR: Cannot install bayesflow==1.1.1, bayesflow==1.1.2, bayesflow==1.1.3, bayesflow==1.1.4 and bayesflow==1.1.5 because these package versions have conflicting dependencies.

The conflict is caused by:
    bayesflow 1.1.5 depends on tensorflow-macos<2.16 and >=2.10; sys_platform == "darwin" and platform_machine == "arm64"
    bayesflow 1.1.4 depends on tensorflow-macos>=2.10; sys_platform == "darwin" and platform_machine == "arm64"
    bayesflow 1.1.3 depends on tensorflow-macos>=2.10; sys_platform == "darwin" and platform_machine == "arm64"
    bayesflow 1.1.2 depends on tensorflow-macos>=2.10; sys_platform == "darwin" and platform_machine == "arm64"
    bayesflow 1.1.1 depends on tensorflow-macos>=2.10; sys_platform == "darwin" and platform_machine == "arm64"

Underlying Cause

After some initial research, this looks like a consequence of a breaking change in tensorflow 2.16.1: Apple Silicon users shall now use pip install tensorflow (new) instead of pip install tensorflow-macos (old).

Source: https://github.com/tensorflow/tensorflow/releases/tag/v2.16.1

BayesFlow's current setup.cfg still differentiates between OS types to install either tensorflow or tensorflow-macos.

Solution

BayesFlow's setup.cfg needs to be updated. If we decide to stop support for the legacy Apple x86 hardware (Intel chips), we can just remove the conditional statement in setup.cfg and always install tensorflow. Opinions appreciated.

@marvinschmitt marvinschmitt added the bug Something isn't working label Mar 19, 2024
@marvinschmitt marvinschmitt self-assigned this Mar 19, 2024
@marvinschmitt
Copy link
Collaborator Author

marvinschmitt commented Mar 19, 2024

We might maintain experimental Apple x86 support by the following conditional statements in setup.cfg:

tensorflow-macos >= 2.10, < 2.16; sys_platform == 'darwin' and platform_machine == 'x86_64'
tensorflow >= 2.10.1, < 2.16; sys_platform != 'darwin' or platform_machine == 'arm64'

sys_platform=='darwin' means "MacOS" and platform_machine=='arm64' means "Apple Silicon (M1 etc.). This way, we always install tensorflow unless users are on MacOS with x86 chips.

Python environment marker reference: https://peps.python.org/pep-0508/#environment-markers

marvinschmitt added a commit that referenced this issue Mar 19, 2024
Fix dependency conflict during installation on Mac Apple Silicon, #153
@marvinschmitt marvinschmitt mentioned this issue Mar 19, 2024
yugahikida pushed a commit to yugahikida/BayesFlow that referenced this issue Aug 24, 2024
Fix dependency conflict during installation on Mac Apple Silicon, stefanradev93#153
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

No branches or pull requests

1 participant