Skip to content

Commit bce4e1f

Browse files
author
Marwan Mattar
authored
Merge pull request #568 from Unity-Technologies/develop-improve-jupyter-notebook
Added simple check to Python version in notebook.
2 parents ba79dd2 + e7e8174 commit bce4e1f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

python/Basics.ipynb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"source": [
1616
"### 1. Set environment parameters\n",
1717
"\n",
18-
"Be sure to set `env_name` to the name of the Unity environment file you want to launch."
18+
"Be sure to set `env_name` to the name of the Unity environment file you want to launch. Ensure that the environment build is in the `python/` directory."
1919
]
2020
},
2121
{
@@ -34,7 +34,9 @@
3434
"cell_type": "markdown",
3535
"metadata": {},
3636
"source": [
37-
"### 2. Load dependencies"
37+
"### 2. Load dependencies\n",
38+
"\n",
39+
"The following loads the necessary dependencies and checks the Python version (at runtime). ML-Agents (v0.3 onwards) requires Python 3."
3840
]
3941
},
4042
{
@@ -47,10 +49,18 @@
4749
"source": [
4850
"import matplotlib.pyplot as plt\n",
4951
"import numpy as np\n",
52+
"import sys\n",
5053
"\n",
5154
"from unityagents import UnityEnvironment\n",
5255
"\n",
53-
"%matplotlib inline"
56+
"%matplotlib inline\n",
57+
"\n",
58+
"print(\"Python version:\")\n",
59+
"print(sys.version)\n",
60+
"\n",
61+
"# check Python version\n",
62+
"if (sys.version_info[0] < 3):\n",
63+
" raise Exception(\"ERROR: ML-Agents (v0.3 onwards) requires Python 3\")"
5464
]
5565
},
5666
{

0 commit comments

Comments
 (0)