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

gcloud builds operation newly fails using Python 3.10.8, OR-Tools 9.4.1874 #245

Closed
dfoulser opened this issue Nov 17, 2022 · 2 comments
Closed

Comments

@dfoulser
Copy link

I am using Python 3.10.8 and an env unchanged since about 2-3 weeks ago, when this command used to work. Now it fails
gcloud builds submit --pack image=gcr.io/solver-28204/poll-scheduler-solver

I'm using ortools 9.4.1874 and numpy 1.23.4 (which I upgraded from 1.23.2 while troubleshooting, to no avail).

I suspect that this has something to do with issue "Python 3.11 support #3515" (google/or-tools#3515) but am stumped on how to fix it. Right now I cannot build the gcloud version of my OR-Tools app.

Any suggestions appreciated.

[builder] Collecting numpy==1.23.4
[builder] Downloading numpy-1.23.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
[builder] ???????????????????????????????????????? 17.1/17.1 MB 40.3 MB/s eta 0:00:00
[builder] ERROR: Ignored the following versions that require a different python version: 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11
[builder] ERROR: Could not find a version that satisfies the requirement ortools==9.4.1874 (from versions: none)
[builder] ERROR: No matching distribution found for ortools==9.4.1874

@matthewrobertson
Copy link
Member

I suspect you aren't pinning your python version, so the buildpacks started using python 3.11.0 automatically when it became available last week. You can pin your python version by either:

  1. Adding a .python-version file to your application root and specifying a version constraint like:
    3.10.x
    
  2. Passing the version constraint via the GOOGLE_PYTHON_VERSION or GOOGLE_RUNTIME_VERSION build environment variables.

See #242 for another person who hit this issue recently.

@dfoulser
Copy link
Author

Excellent. That solved it. Thanks.

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