Skip to content

Minimum Python version is 3.8, Max is 3.9 (or 3.11) #40

@aneroid

Description

@aneroid

Minimum = 3.8

The ReadMe says "Or run the script with Python 3.6+:"

* [**DOWNLOAD HERE**](https://github.com/FluffyMaguro/SC2_Coop_Overlay/releases/download/2.47/SC2CoopOverlay.2.47.zip)
* Or run the script with Python 3.6+:

However:

  1. SCO uses dataclasses, which were introduced in Python 3.7 and are not available in 3.6.

  2. For SCOFunctions\MassReplayAnalysis.py -> calculate_player_winrate_data, the line mode = statistics.mode(commanders) can raise an error statistics.StatisticsError: no unique mode; found 2 equally common values.
    This was fixed in Python 3.8, to select the first occurrence when the counts are equal.

    Changed in version 3.8: Now handles multimodal datasets by returning the first mode encountered. Formerly, it raised StatisticsError when more than one mode was found.

    If we stick to 3.6 or 3.7, this will need to be replaced with a check for duplicates before calling mode(). Or perhaps by using collections.Counter.

Or, we can just update the ReadMe.

Maximum = 3.9

If I use Python 3.10 or 3.11, the pinned library versions for PyQt5 and PyQtWebEngine will not install.

PyQt5==5.15.2
PyQtWebEngine==5.15.2

For PyQt5:

Collecting PyQt5==5.15.2 (from -r requirements.txt (line 3))
  error: subprocess-exited-with-error
        ...
      Traceback (most recent call last):
        ...
        File "C:\Folder\AppData\Local\Temp\pip-build-env-vfrhjnyo\overlay\Lib\site-packages\pyqtbuild\builder.py", line 49, in apply_user_defaults
          raise PyProjectOptionException('qmake',
      sipbuild.pyproject.PyProjectOptionException
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> PyQt5

For PyQtWebEngine:

Collecting PyQtWebEngine==5.15.2 (from -r requirements.txt (line 4))
  error: subprocess-exited-with-error
        ...
      Traceback (most recent call last):
        ...
        File "C:\Folder\AppData\Local\Temp\pip-build-env-gq8pifp8\overlay\Lib\site-packages\pyqtbuild\builder.py", line 49, in apply_user_defaults
          raise PyProjectOptionException('qmake',
      sipbuild.pyproject.PyProjectOptionException
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> PyQtWebEngine

However, if I update the version to the latest (as of today), then I can use Python 3.10 and 3.11:

PyQt5==5.15.11
PyQtWebEngine==5.15.7

These two latest versions work on Python 3.8, so can be updated in requirements. And for the reasons noted above, 3.8 is the new minimum.

PS. I tested all this by re-creating venv with each version of Python mentioned, activating the venv, and starting the overlay with python SCO.py. Waited to see if (a) the GUI opens and then (b) a few mins for the replay analysis to complete.

Maximum = 3.11

SCO uses Blizzard's s2protocol which uses the imp library. The last version to have it is Python 3.11, since it was removed in Python 3.12. While there is a PR to replace it with importlib, it's been open for 2 years, so not realistic to expect it to be merged/fixed soon, if ever.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions