Skip to content

Warn or error when using unsupported Python version #8156

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

Closed
GregoryComer opened this issue Feb 3, 2025 · 5 comments
Closed

Warn or error when using unsupported Python version #8156

GregoryComer opened this issue Feb 3, 2025 · 5 comments
Labels
enhancement Not as big of a feature, but technically not a bug. Should be easy to fix module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch module: user experience Issues related to reducing friction for users triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@GregoryComer
Copy link
Member

GregoryComer commented Feb 3, 2025

🚀 The feature, motivation and pitch

Lowering can fail in weird ways when using older, unsupported Python versions. We should warn or error out when importing the executorch Python package on an unsupported Python version.

See #2025 for an example of this.

Alternatives

No response

Additional context

No response

RFC (Optional)

No response

cc @larryliu0820 @lucylq @mergennachin @byjlw

@GregoryComer GregoryComer added the module: user experience Issues related to reducing friction for users label Feb 3, 2025
@github-project-automation github-project-automation bot moved this to To triage in ExecuTorch DevX Feb 3, 2025
@digantdesai digantdesai added enhancement Not as big of a feature, but technically not a bug. Should be easy to fix triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Feb 4, 2025
@mergennachin mergennachin moved this from To triage to Ready in ExecuTorch DevX Feb 6, 2025
@mergennachin mergennachin moved this from Ready to Backlog in ExecuTorch DevX Feb 6, 2025
@ahbpp
Copy link

ahbpp commented Feb 20, 2025

Hi there,

I'm not sure, but if the Python version is unsupported, it may be better to exit with an error in setup.py similar to the PyTorch repo (See: https://github.com/pytorch/pytorch/blob/main/setup.py#L240 ).

Or, if you think that it is better to error when importing, it can be in __init__.py at the package's root

I’d be happy to help with this issue if that’s okay

@mergennachin
Copy link
Contributor

@ahbpp - feel free to put up a PR, thank you

cc @dbort , @larryliu0820 , @jathu

@GregoryComer
Copy link
Member Author

Thanks for taking a look at this. Doing it setup.py seems reasonable.

@larryliu0820 larryliu0820 added the module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch label Feb 20, 2025
@ahbpp
Copy link

ahbpp commented Feb 21, 2025

Sorry, it is actually already implemented in install_requirements.py.
if executorch works with python>=3.11, the issue is resolved

(executorch_39) alekseikarpov:executorch_fork/ (main✗) $ ./install_executorch.sh                                                                                                                           
ERROR: ExecuTorch does not support python version 3.9.21: must satisfy ">=3.10"
(executorch_39) alekseikarpov:executorch_fork/ (main✗) $ python --version                                                                                                                                  
Python 3.9.21

@GregoryComer
Copy link
Member Author

@ahbpp Ah, that must have been added semi-recently. Sorry about that. Thanks for finding this. I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Not as big of a feature, but technically not a bug. Should be easy to fix module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch module: user experience Issues related to reducing friction for users triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Status: Done
Development

No branches or pull requests

5 participants