Skip to content

Commit

Permalink
Upgrade to Python 3.11
Browse files Browse the repository at this point in the history
Python 3.10 Active Support ended in Apr 2023: https://endoflife.date/python.

"Python 3.11 is between 10-60% faster than Python 3.10"
  • Loading branch information
alex-mccarthy-unity committed Mar 14, 2024
1 parent fb2af76 commit b00fcb8
Show file tree
Hide file tree
Showing 28 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/colab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10.12
python-version: 3.11.8
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.10.12
python-version: 3.11.8
- uses: actions/setup-node@v4
with:
node-version: '12'
Expand All @@ -39,9 +39,9 @@ jobs:
# If one test in the matrix fails we still want to run the others.
fail-fast: false
matrix:
python-version: [3.10.12]
python-version: [3.11.8]
include:
- python-version: 3.10.12
- python-version: 3.11.8
pip_constraints: test_constraints_version.txt
steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.10.x
python-version: 3.11.x
- uses: ruby/setup-ruby@v1
env:
ImageOS: ubuntu20
Expand All @@ -39,7 +39,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.10.x
python-version: 3.11.x
- uses: actions/setup-node@v4
with:
node-version: '12'
Expand All @@ -58,5 +58,5 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.10.x
python-version: 3.11.x
- run: python utils/validate_meta_files.py
4 changes: 2 additions & 2 deletions .github/workflows/publish_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.PUBLIC_GH_TOKEN }}
- name: Setup Python 3.10
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.10
python-version: 3.11
- name: Publish docs
run: |
pip install mkdocs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:

steps:
- uses: actions/checkout@main
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.10.x
python-version: 3.11.x
- name: Install dependencies
run: pip install setuptools wheel twine --user
- name: verify git tag vs. version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_pypi_python_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.10.x
python-version: 3.11.x
- name: Install dependencies
run: pip install setuptools wheel twine --user
- name: verify git tag vs. version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
# If one test in the matrix fails we still want to run the others.
fail-fast: false
matrix:
python-version: [3.10.12]
python-version: [3.11.8]
include:
- python-version: 3.10.12
- python-version: 3.11.8
pip_constraints: test_constraints_version.txt
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .yamato/com.unity.ml-agents-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test_coverage_{{ package.name }}_{{ platform.name }}_{{ editor.version }}_{{ edi
- npm install [email protected] -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci project test -u {{ editor.version }} --type project-tests --project-path {{ editor.testProject }} --package-filter {{ package.name }} {{ coverageOptions }} --extra-utr-arg "reruncount=2"
- |
conda activate python3.10
conda activate python3.11
python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ package.minCoveragePct }}
artifacts:
logs:
Expand Down
2 changes: 1 addition & 1 deletion .yamato/com.unity.ml-agents-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pack:
commands:
- |
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
conda activate python3.10
conda activate python3.11
python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
unity-downloader-cli -u 2023.2 -c editor --wait --fast
./.Editor/Unity -projectPath Project -batchMode -executeMethod Unity.MLAgents.SampleExporter.ExportCuratedSamples -logFile -
Expand Down
2 changes: 1 addition & 1 deletion .yamato/com.unity.ml-agents-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ test_{{ package.name }}_{{ platform.name }}_{{ editor.version}}_{{ editor.testPr
commands:
- |
{% if platform.name == "linux" %}
conda activate python3.10
conda activate python3.11
{% endif %}
python -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
unity-downloader-cli -u trunk -c editor --wait --fast
Expand Down
2 changes: 1 addition & 1 deletion .yamato/compressed-sensor-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_compressed_obs_{{ editor.version }}_{{ editor.extra_test }}:
commands:
- |
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
conda activate python3.10
conda activate python3.11
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python -u -m ml-agents.tests.yamato.setup_venv
python ml-agents/tests/yamato/scripts/run_compressed_sensor.py --env=artifacts/testPlayer-TestGridCompressed
Expand Down
2 changes: 1 addition & 1 deletion .yamato/gym-interface-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_gym_interface_{{ editor.version }}_{{ editor.extra_test }}:
commands:
- |
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
conda activate python3.10
conda activate python3.11
python -m pip install wheel --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python -u -m ml-agents.tests.yamato.setup_venv
Expand Down
2 changes: 1 addition & 1 deletion .yamato/protobuf-generation-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_linux_protobuf_generation:
- |
sudo apt-get update && sudo apt-get install -y nuget
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
conda activate python3.10
conda activate python3.11
nuget install Grpc.Tools -Version $GRPC_VERSION -OutputDirectory protobuf-definitions/
python3 -m pip install --upgrade pip --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python3 -m pip install grpcio==1.48.2 grpcio-tools==1.48.2 protobuf==3.19.6 six==1.16.0 mypy-protobuf==1.16.0 --progress-bar=off --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
Expand Down
2 changes: 1 addition & 1 deletion .yamato/pytest-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pytest_gpu:
commands:
- |
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
conda activate python3.10
conda activate python3.11
python3 -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python3 -u -m ml-agents.tests.yamato.setup_venv
python3 -m pip install --progress-bar=off -r test_requirements.txt --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
Expand Down
2 changes: 1 addition & 1 deletion .yamato/python-ll-api-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_linux_ll_api_{{ editor.version }}_{{ editor.extra_test }}:
commands:
- |
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
conda activate python3.10
conda activate python3.11
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python -u -m ml-agents.tests.yamato.setup_venv
python ml-agents/tests/yamato/scripts/run_llapi.py
Expand Down
2 changes: 1 addition & 1 deletion .yamato/standalone-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_linux_standalone_{{ editor.version }}_{{ editor.extra_test }}:
commands:
- |
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
conda activate python3.10
conda activate python3.11
python3 -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
unity-downloader-cli -u {{ editor.version }} -c editor --wait --fast
Expand Down
2 changes: 1 addition & 1 deletion .yamato/standalone-build-webgl-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test_webgl_standalone_{{ editor_version }}:
commands:
- |
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
conda activate python3.10
conda activate python3.11
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
unity-downloader-cli -u {{ editor_version }} -c editor -c WebGL --wait --fast
Expand Down
2 changes: 1 addition & 1 deletion .yamato/training-int-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_linux_training_int_{{ editor.version }}_{{ editor.extra_test }}:
commands:
- |
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
conda activate python3.10
conda activate python3.11
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python -u -m ml-agents.tests.yamato.training_int_tests
dependencies:
Expand Down
12 changes: 6 additions & 6 deletions docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The ML-Agents Toolkit contains several components:
Consequently, to install and use the ML-Agents Toolkit you will need to:

- Install Unity (2023.2 or later)
- Install Python (3.10.12 or higher)
- Install Python (3.11.8)
- Clone this repository (Recommended for the latest version and bug fixes)
- __Note:__ If you do not clone the repository, then you will not be
able to access the example environments and training configurations or the
Expand All @@ -43,21 +43,21 @@ Consequently, to install and use the ML-Agents Toolkit you will need to:
strongly recommend that you install Unity through the Unity Hub as it will
enable you to manage multiple Unity versions.

### Install **Python 3.10.12**
### Install **Python 3.11.8**

We recommend [installing](https://www.python.org/downloads/) Python 3.10.12.
We recommend [installing](https://www.python.org/downloads/) Python 3.11.8.
If you are using Windows, please install the x86-64 version and not x86.
If your Python environment doesn't include `pip3`, see these
[instructions](https://packaging.python.org/guides/installing-using-linux-tools/#installing-pip-setuptools-wheel-with-linux-package-managers)
on installing it. We also recommend using [conda](https://docs.conda.io/en/latest/) or [mamba](https://github.com/mamba-org/mamba) to manage your python virtual environments.

#### Conda python setup

Once conda has been installed in your system, open a terminal and execute the following commands to setup a python 3.10.12 virtual environment
Once conda has been installed in your system, open a terminal and execute the following commands to setup a python 3.11.8 virtual environment
and activate it.

```shell
conda create -n mlagents python=3.10.12 && conda activate mlagents
conda create -n mlagents python=3.11.8 && conda activate mlagents
```

### Clone the ML-Agents Toolkit Repository (Recommended)
Expand Down Expand Up @@ -161,7 +161,7 @@ for more installation options and versions.

#### (OS X) Installing GRPC libraries

On OS X, you may need to explicitly install the GRPC runtime libraries to avoid hitting errors when training like `dlopen(/Users/alex.mccarthy/miniconda3/envs/mlagents/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_CFRelease'`.
On OS X, you may need to explicitly install the GRPC runtime libraries to avoid hitting errors when training like `dlopen(/Users/alex.mccarthy/miniconda3/envs/mlagents/lib/python3.11/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_CFRelease'`.

```sh
pip3 install grpcio
Expand Down
4 changes: 2 additions & 2 deletions docs/Migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
TODO: update ml-agents-env package version before release
--->
## Migrating to the ml-agents-envs 0.30.0 package
- Python 3.10.12 is now the minimum version of python supported due to [python3.6 EOL](https://endoflife.date/python).
Please update your python installation to 3.10.12 or higher.
- Python 3.11.0 is now the minimum version of python supported due to [python3.10 active support ending](https://endoflife.date/python).
Please update your python installation to 3.11.8.
- The `gym-unity` package has been refactored into the `ml-agents-envs` package. Please update your imports accordingly.
- Example:
- Before
Expand Down
6 changes: 3 additions & 3 deletions docs/Tutorial-Custom-Trainer-Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Step 1: Write your custom trainer class
Before you start writing your code, make sure to use your favorite environment management tool(e.g. `venv` or `conda`) to create and activate a Python virtual environment. The following command uses `conda`, but other tools work similarly:
```shell
conda create -n trainer-env python=3.10.12
conda create -n trainer-env python=3.11.8
conda activate trainer-env
```

Expand Down Expand Up @@ -260,9 +260,9 @@ mlagents-learn ml-agents-trainer-plugin/mlagents_trainer_plugin/a2c/a2c_3DBall.y
```

### Validate your implementations:
Create a clean Python environment with Python 3.10.12 and activate it before you start, if you haven't done so already:
Create a clean Python environment with Python 3.11.8 and activate it before you start, if you haven't done so already:
```shell
conda create -n trainer-env python=3.10.12
conda create -n trainer-env python=3.11.8
conda activate trainer-env
```

Expand Down
4 changes: 2 additions & 2 deletions docs/Using-Virtual-Environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ from dependencies of other projects. This has a few advantages:
with the different version.

## Python Version Requirement (Required)
This guide has been tested with Python 3.10.12. Newer versions might not
This guide has been tested with Python 3.11.8. Newer versions might not
have support for the dependent libraries, so are not recommended.

## Use Conda (or Mamba)
Expand Down Expand Up @@ -67,7 +67,7 @@ then python3-distutils needs to be installed. Install python3-distutils using
environment using the same `activate` command listed above)

Note:
- Verify that you are using Python version 3.10.12. Launch a
- Verify that you are using Python version 3.11.8. Launch a
command prompt using `cmd` and execute `python --version` to verify the version.
- Python3 installation may require admin privileges on Windows.
- This guide is for Windows 10 using a 64-bit architecture only.
8 changes: 4 additions & 4 deletions localized_docs/KR/docs/Installation-Anaconda-Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ ML-Agents toolkit�� ����ϱ� ����, �Ʒ��� ���

Windows ������ Anaconda�� [�ٿ�ε�](https://www.anaconda.com/download/#windows)�ϰ� ��ġ�Ͻʽÿ�.
Anaconda�� ��������ν�, �ٸ� ���� ������ Python�� �и��� ȯ�濡�� ������ �� �ֽ��ϴ�.
Python 2�� ���̻� �������� �ʱ� ������ Python 3.10�� �ʿ��մϴ�. �� ���̵忡�� �츮��
Python 3.10.12 ������ Anaconda 5.1 ������ ����� ���Դϴ�.
Python 2�� ���̻� �������� �ʱ� ������ Python 3.11�� �ʿ��մϴ�. �� ���̵忡�� �츮��
Python 3.11.8 ������ Anaconda 2023.09 ������ ����� ���Դϴ�.
([64-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86_64.exe)
�Ǵ� [32-bit](https://repo.continuum.io/archive/Anaconda3-5.1.0-Windows-x86.exe)
��ũ).
Expand Down Expand Up @@ -65,11 +65,11 @@ ML-Agents toolkit�� �Բ� ����� ���ο� [Conda ȯ��]
��ɾ Ÿ���� �Ͻʽÿ�:

```sh
conda create -n ml-agents python=3.10.12
conda create -n ml-agents python=3.11.08
```

�� ��Ű���� ��ġ�ϱ� ���� �޼����� ���� ��� `y`�� Ÿ�����ϰ� ���͸� �����ʽÿ� _(���ͳ��� ����Ǿ��ִ��� Ȯ���Ͻʽÿ�)_.
�� �䱸�Ǵ� ��Ű������ �ݵ�� ��ġ�ؾ� �մϴ�. ���ο� Conda ȯ�濡�� Python 3.10.12 ������ ���Ǹ� ml-agents�� ȣ��˴ϴ�.
�� �䱸�Ǵ� ��Ű������ �ݵ�� ��ġ�ؾ� �մϴ�. ���ο� Conda ȯ�濡�� Python 3.11.8 ������ ���Ǹ� ml-agents�� ȣ��˴ϴ�.

<p align="center">
<img src="images/conda_new.PNG" alt="Anaconda Install" width="500" border="10" />
Expand Down
4 changes: 2 additions & 2 deletions localized_docs/KR/docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ git clone https://github.com/Unity-Technologies/ml-agents.git

### 파이썬과 mlagents 패키지 설치

ML-Agents toolkit을 사용하기 위해 [setup.py file](../ml-agents/setup.py)에 나열된 종속성과 함께 파이썬 3.10.12이 필요합니다.
ML-Agents toolkit을 사용하기 위해 [setup.py file](../ml-agents/setup.py)에 나열된 종속성과 함께 파이썬 3.11.8이 필요합니다.
주요 종속성의 일부는 다음을 포함합니다:

- [TensorFlow](Background-TensorFlow.md) (Requires a CPU w/ AVX support)
- [Jupyter](Background-Jupyter.md)

Python 3.10.12이 만약 설치되어 있지 않다면, [다운로드](https://www.python.org/downloads/)하고 설치하십시오.
Python 3.11.8이 만약 설치되어 있지 않다면, [다운로드](https://www.python.org/downloads/)하고 설치하십시오.

만약 당신의 파이썬 환경이 `pip3`을 포함하지 않는다면, 다음
[지시사항](https://packaging.python.org/guides/installing-using-linux-tools/#installing-pip-setuptools-wheel-with-linux-package-managers)
Expand Down
6 changes: 3 additions & 3 deletions localized_docs/RU/docs/Установка.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ML-Agents Toolkit состоит из нескольких компоненто

Итого, чтобы установить и использовать ML-Agents, вам нужно:
- Установить Unity (2022.3 или более позднюю версию)
- Установить Python (3.10.12 или более позднюю версию)
- Установить Python (3.11.8 или более позднюю версию)
- Клонировать этот репозиторий (Опционально)
- __Примечание:__ если вы не склонируете репозиторий, тогда у вас не будет доступа к примерам и конфигурациям обучения.
Также, раздел "Начало работы" подразумевает, что вы сделали клон репозитория.
Expand All @@ -31,9 +31,9 @@ ML-Agents Toolkit состоит из нескольких компоненто
[Загрузите](https://unity3d.com/get-unity/download) и установите движок Unity.
Мы очень рекомендуем установить Unity через Unity Hub, так как последний позволяет управлять разными версиями движка.

### Установка **Python 3.10.12** или более поздней версии
### Установка **Python 3.11.8**

Мы рекомендуем [установить](https://www.python.org/downloads/) Python 3.10.12
Мы рекомендуем [установить](https://www.python.org/downloads/) Python 3.11.8
Если вы используете Windows, пожалуйста, установите x86-64 версию, а не x86.
Если у вас нет системы управления пакетами `pip3` для Python, пожалуйста,
воспользуйтесь [этими инструкциями](https://packaging.python.org/guides/installing-using-linux-tools/#installing-pip-setuptools-wheel-with-linux-package-managers)
Expand Down
Loading

0 comments on commit b00fcb8

Please sign in to comment.