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

Python 3.8 and 3.9 not found on macOS #850

Closed
2 of 5 tasks
ZeroIntensity opened this issue Apr 23, 2024 · 11 comments
Closed
2 of 5 tasks

Python 3.8 and 3.9 not found on macOS #850

ZeroIntensity opened this issue Apr 23, 2024 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@ZeroIntensity
Copy link

ZeroIntensity commented Apr 23, 2024

Description:
Python 3.8 and 3.9 on macOS no longer work, and actions complains about them not being a real version.

Action version:
Latest

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
Python 3.8 - Python 3.9. It might be all versions <Python 3.10, but I haven't tested that.

Repro steps:
See this run from yesterday, vs this run from this morning on the same commit.

Expected behavior:
Python 3.8 and 3.9 should install on macOS

Actual behavior:
The following is logged to actions:

Version 3.8 was not found in the local cache
Error: Version 3.8 with arch arm64 not found
The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
@ZeroIntensity ZeroIntensity added bug Something isn't working needs triage labels Apr 23, 2024
@hugovk
Copy link
Contributor

hugovk commented Apr 23, 2024

This is a duplicate, macos-latest now uses M1 runners (macos-14-arm64) and 3.9 and earlier aren't available there: #696 (comment)

To fix, you can use one of the options at python/peps#3763, or stick to macos-12 or macos-13 (but you get some nice speedups using M1 where available).

@snorkman88
Copy link

I am facing the same issues when running GHA I get:

Installed versions
  Version 3.8 was not found in the local cache
  Error: The version '3.8' with architecture 'arm64' was not found for macOS 14.4.1.

@ZeroIntensity
Copy link
Author

Odd, that issue is from months ago, but I only started having problems this morning.

@hugovk
Copy link
Contributor

hugovk commented Apr 23, 2024

Yeah, macos-latest used to point to macos-12 but now points to macos-14-arm64.

You can check the top of your CI logs to see which image was used yesterday and today.

gcattan added a commit to qbarthelemy/pyRiemann-qiskit that referenced this issue Apr 23, 2024
gcattan added a commit to pyRiemann/pyRiemann-qiskit that referenced this issue Apr 23, 2024
* deprecate cov_to_corr_matrix

* change import for deprecated

* Update setup.py

fix setup.py

* Update requirements.txt

add mne dependency to requirement file for doc only

* Update Dockerfile

remove protobuf install in Dockerfile (now by default in setup.py)

* Update light_benchmark.py

flake8  # noqa: E231

* Update plot_financial_data.py

flake8

* Update light_benchmark.yml

trigger benchmark on change to setup.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

* Update testing.yml

as per actions/setup-python#850 (comment)

---------

Co-authored-by: gcattan <gcattan@hotmail.fr>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@Paebbels
Copy link

The list of offered Python versions is here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

It shows no Python 3.8 and Python 3.9 for macOS (Python for ARM64 platform).

@HarithaVattikuti
Copy link
Contributor

Hello @ZeroIntensity
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

@Olegt0rr
Copy link

Olegt0rr commented Apr 25, 2024

Hello @ZeroIntensity

We are supporting python 3.8 and 3.9 versions for macos arm64 now. Please test your workflows.

Feel Free to reach out to us in case of any issues.

It works, thanks

Tested here: https://github.com/aio-libs/aiohttp-sse/actions/runs/8828949346?pr=488

@abravalheri
Copy link

abravalheri commented Apr 26, 2024

We are supporting python 3.8 and 3.9 versions for macos arm64 now. Please test your workflows.

Feel Free to reach out to us in case of any issues.

Hi @HarithaVattikuti, I am still having trouble with macos-latest and 3.8:

Run actions/setup-python@v5
  with:
    python-version: 3.8
    allow-prereleases: true
    check-latest: false
    token: ***
    update-environment: true
  env:
    FORCE_COLOR: 1
    PIP_DISABLE_PIP_VERSION_CHECK: true
    PIP_NO_PYTHON_VERSION_WARNING: true
    PIP_NO_WARN_SCRIPT_LOCATION: true
    TOX_OVERRIDE: testenv.pass_env+=GITHUB_*,FORCE_COLOR
    SETUPTOOLS_USE_DISTUTILS: local
Installed versions
  Version ~3.8.0-0 was not found in the local cache
  Version ~3.8.0-0 is available for downloading
  Download from "https://github.com/actions/python-versions/releases/download/3.8.10-8833490[2](https://github.com/pypa/setuptools/actions/runs/8844957694/job/24287879211?pr=4329#step:3:2)98/python-[3](https://github.com/pypa/setuptools/actions/runs/8844957694/job/24287879211?pr=4329#step:3:3).8.10-darwin-arm64.tar.gz"
  Extract downloaded archive
  /usr/bin/tar xz -C /Users/runner/work/_temp/c[4](https://github.com/pypa/setuptools/actions/runs/8844957694/job/24287879211?pr=4329#step:3:4)9b1822-0f6f-4d2a-ae95-fdae63cc4323 -f /Users/runner/work/_temp/8c0d1b73-e480-404c-904b-98876ab86d14
  Execute installation script
  Check if Python hostedtoolcache folder exist...
  Install Python binaries from prebuilt package
  installer: Package name is Python
  installer: Upgrading at base path /
  installer: The upgrade was successful.
  Create hostedtoolcach symlinks (Required for the backward compatibility)
  Create Python 3.8.10 folder
  Create additional symlinks (Required for the UsePythonVersion Azure Pipelines task and the setup-python GitHub Action)
  Upgrading pip...
  Error: Traceback (most recent call last):
    File "<string>", line 6, in <module>
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 203, in run_module
      mod_name, mod_spec, code = _get_module_details(mod_name)
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 130, in _get_module_details
      spec = importlib.util.find_spec(mod_name)
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/util.py", line 103, in find_spec
      return _find_spec(fullname, parent_path)
    File "<frozen importlib._bootstrap>", line 914, in _find_spec
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 79, in find_spec
      return method()
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 100, in spec_for_pip
      if self.pip_imported_during_build():
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 111, in pip_imported_during_build
      return any(
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 112, in <genexpr>
      frame.f_globals['__file__'].endswith('setup.py')
  KeyError: '__file__'
  Error: Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
      exec(code, run_globals)
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ensurepip/__main__.py", line [5](https://github.com/pypa/setuptools/actions/runs/8844957694/job/24287879211?pr=4329#step:3:5), in <module>
      sys.exit(ensurepip._main())
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ensurepip/__init__.py", line 20[6](https://github.com/pypa/setuptools/actions/runs/8844957694/job/24287879211?pr=4329#step:3:6), in _main
      return _bootstrap(
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ensurepip/__init__.py", line 125, in _bootstrap
      return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ensurepip/__init__.py", line 34, in _run_pip
      return subprocess.run([sys.executable, "-c", code], check=True).returncode
    File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 516, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['/Library/Frameworks/Python.framework/Versions/3.8/bin/python', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/var/folders/3m/p59k4qdj0f1[7](https://github.com/pypa/setuptools/actions/runs/8844957694/job/24287879211?pr=4329#step:3:7)st0gn2cmj3640000gn/T/tmpezbv7_yj/setuptools-56.0.0-py3-none-any.whl\', \'/var/folders/3m/p5[9](https://github.com/pypa/setuptools/actions/runs/8844957694/job/24287879211?pr=4329#step:3:9)k4qdj0f17st0gn2cmj3640000gn/T/tmpezbv7_yj/pip-21.1.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/var/folders/3m/p59k4qdj0f17st0gn2cmj3640000gn/T/tmpezbv7_yj\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.

https://github.com/pypa/setuptools/actions/runs/8844957694/job/24287879211?pr=4329

JelleZijlstra pushed a commit to python/mypy that referenced this issue Apr 27, 2024
Fix failing MacOS tests in CI

Python 3.9 is not available on the latest MacOS images
actions/setup-python#850

---------

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
WenjieDu added a commit to WenjieDu/PyPOTS that referenced this issue Apr 29, 2024
* test: stick to macOS-13 to avoid python 3.7 missing for m1 chip;

actions/setup-python#850
jdkent pushed a commit to neurostuff/PyMARE that referenced this issue Apr 30, 2024
…tion term in Stouffers (#121)

* Support precomputed correlation matrix for calculating variance inflation term in Stouffers

* Update test_results.py

* Switch to macos-12 per actions/setup-python#850

* Update test_results.py
yoda-vid added a commit to sanderslab/magellanmapper that referenced this issue May 1, 2024
Python 3.6-3.9 is no longer supported on `macos-latest`, which was recently updated to `macos-14-arm64` (see actions/setup-python#850 (comment)).

- Target macOS runner platforms by supported Python version
- Simplify specification of Ubuntu runners by moving `ubuntu-20.04` to an `include` statement
yoda-vid added a commit to sanderslab/magellanmapper that referenced this issue May 2, 2024
Python 3.6-3.9 is no longer supported on `macos-latest`, which was recently updated to `macos-14-arm64` (see actions/setup-python#850 (comment)).

- Target macOS runner platforms by supported Python version
- Simplify specification of Ubuntu runners by moving `ubuntu-20.04` to an `include` statement
@aparnajyothi-y aparnajyothi-y self-assigned this May 6, 2024
@aparnajyothi-y
Copy link

Hello @ZeroIntensity, We are supporting python 3.8 and 3.9 versions for macos arm64 now. Please test your workflows. Closing this issue for now and let us know to reopen this issue if the you are still facing the issue.

Hello @abravalheri, We have investigated the issue and we found that setup-python is successful on macos-latest. We have further more investigated by looking into your project about the issue and found that the file attribute is not found in the global scope of a module being used, which in this case is the setup.py file. The issue occurs in the context of the setup-python action when it tries to install setuptools and pip. The error is more likely to do with how the environment is configured in the action rather than the macOS version.
We can add a step to upgrade setuptools before the step where the error occurs to resolve the issue.

name: Upgrade setuptools
run: pip install --upgrade setuptools

we can change the setup.py file in the repository, consider replacing it with pyproject.toml and setup.cfg. The pyproject.toml file is a newer, more robust method of managing Python package builds and dependencies.
Please raise new issue if the issue still exists as this issue is opened for Python 3.8 and 3.9 support on macOS.

@abravalheri
Copy link

abravalheri commented May 7, 2024

Hello @abravalheri, We have investigated the issue and we found that setup-python is successful on macos-latest. We have further more investigated by looking into your project about the issue and found that the file attribute is not found in the global scope of a module being used, which in this case is the setup.py file. The issue occurs in the context of the setup-python action when it tries to install setuptools and pip. The error is more likely to do with how the environment is configured in the action rather than the macOS version.\nWe can add a step to upgrade setuptools before the step where the error occurs to resolve the issue.\n\nname: Upgrade setuptools\nrun: pip install --upgrade setuptools\n\nwe can change the setup.py file in the repository, consider replacing it with pyproject.toml and setup.cfg. The pyproject.toml file is a newer, more robust method of managing Python package builds and dependencies.\nPlease raise new issue if the issue still exists as this issue is opened for Python 3.8 and 3.9 support on macOS.

Hi @aparnajyothi-y thank you for investigating, but this explanation does not make much sense for me.

You suggested installing the updated version of setuptools before the step that is failing... The problem with this suggestion that the problem that is failing is the installation of Python itself... So, how should I update stuff when Python is not installed yet? The step that is failing is very much the first one, it should not depend on the code inside the repository, right?

The second suggestion about replacing setup.py with pyproject.toml, also does not work and actually contains a bit of misleading and innacurate information:

  1. pyproject.toml is by no means more robust, it is just a different configuration format.

  2. setup.py, setup.cfg and pyproject.toml are not mutually exclusive, they can all exist at the same time and do different things - that is exactly what happens in the repository with problems: we have all of these files at the same time.

Please note that the problem is happening for the repository of setuptools itself. Maybe that is related?

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

8 participants