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

PyTorch 2.4.1 wont install on Flet Build for macOS (regression 0.25dev) #4270

Open
1 task done
ap4499 opened this issue Oct 31, 2024 · 1 comment
Open
1 task done
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@ap4499
Copy link

ap4499 commented Oct 31, 2024

Duplicate Check

Describe the bug

On the latest dev build of Flet 0.25, torch==2.4.1 cannot be installed when using Flet Build.

Code sample

Code

#main.py

import torch
import flet

#requirements.txt

flet==0.25.0.dev3598
torch==2.4.1

To reproduce

  1. Setup scripts.
  2. Run Flet build command as below:
export PATH=$HOME/development/flutter/bin:$PATH

flet build macos --project "Demo" --product "Demo" --org "com.ABC" --company "Demo" --build-version "1.0.0" -vv

Expected behavior

Successful install.

Screenshots / Videos

Captures

[Upload media here]

Operating System

macOS

Operating system details

MacOS 15.0.1

Flet version

flet==0.25.0.dev3614

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

No response

Logs

Logs
console
( ●    ) Packaging Python app ⏳... ERROR: Could not find a version that satisfies the requirement torch==2.4.1 (from versions: 2.2.0, 2.2.1, 2.2.2)
ERROR: No matching distribution found for torch==2.4.1

Additional details

The above works when using Flet==0.24.1.

Note, in the above, the code is light as Torch is not being used for anything - this is just illustrating the issue with the Build() process.

@ap4499 ap4499 changed the title PyTorch 2.4.1 wont install on Flet Build (regression) PyTorch 2.4.1 wont install on Flet Build (regression 0.25dev) Oct 31, 2024
@FeodorFitsner FeodorFitsner self-assigned this Nov 1, 2024
@FeodorFitsner
Copy link
Contributor

Trying to build macOS app with torch==2.4.1 and detailed log gives this error:

(   ●  ) Packaging Python app ⏳... Configured Darwin/x86_64 platform with sitecustomize.py
Installing [flet==0.25.0.dev3614, torch==2.4.1] with pip command to /var/folders/39/r38wl7vj2ds6bmcw9sfhsgf80000gn/T/serious_python_tempg1CO8p/__pypackages__/x86_64
(     ●) Packaging Python app ⏳... ERROR: Could not find a version that satisfies the requirement torch==2.4.1 (from versions: 2.2.0, 2.2.1, 2.2.2)

Packaging macOS has been improved in Flet 0.25 and now, by default, it's trying to create a universal app, i.e. include both arm64 and x86_64 dependencies. Here we see that it cannot find x86_64 wheels for torch 2.4.1 and we can confirm that on this page - only macOS arm64 wheels are available: https://pypi.org/project/torch/2.4.1/#files

There is a new --arch option for flet build command that tells it to build only a specific architecture. Currently works only with macOS builds.

Run flet build macos --arch arm64 ... and it will package just fine. Resulting bundle will be able to run on "M" CPUs only.

Let's keep this issue open as a reminder to update docs.

@FeodorFitsner FeodorFitsner changed the title PyTorch 2.4.1 wont install on Flet Build (regression 0.25dev) PyTorch 2.4.1 wont install on Flet Build for macOS (regression 0.25dev) Nov 1, 2024
@FeodorFitsner FeodorFitsner added the documentation Improvements or additions to documentation label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: 🏗 In progress
Development

No branches or pull requests

2 participants