Replace pip install mcpi with %pip which always installs in the right environment

This commit is contained in:
Aurélien Geron
2021-10-07 18:10:34 +13:00
parent b3081ceab6
commit fdb5d1695e
5 changed files with 16 additions and 9 deletions

View File

@@ -52,8 +52,8 @@
"\n",
"if IS_COLAB or IS_KAGGLE:\n",
" !apt update && apt install -y libpq-dev libsdl2-dev swig xorg-dev xvfb\n",
" !pip install -q -U tf-agents pyvirtualdisplay gym[box2d]\n",
" !pip install -q -U atari_py==0.2.5\n",
" %pip install -q -U tf-agents pyvirtualdisplay gym[box2d]\n",
" %pip install -q -U atari_py==0.2.5\n",
"\n",
"# Scikit-Learn ≥0.20 is required\n",
"import sklearn\n",
@@ -220,7 +220,7 @@
"Alternatively, you can install the [pyvirtualdisplay](https://github.com/ponty/pyvirtualdisplay) Python library which wraps Xvfb:\n",
"\n",
"```bash\n",
"python3 -m pip install -U pyvirtualdisplay\n",
"%pip install -U pyvirtualdisplay\n",
"```\n",
"\n",
"And run the following code:"
@@ -2812,7 +2812,7 @@
"metadata": {},
"source": [
"## 8.\n",
"_Exercise: Use policy gradients to solve OpenAI Gym's LunarLander-v2 environment. You will need to install the Box2D dependencies (`python3 -m pip install -U gym[box2d]`)._"
"_Exercise: Use policy gradients to solve OpenAI Gym's LunarLander-v2 environment. You will need to install the Box2D dependencies (`%pip install -U gym[box2d]`)._"
]
},
{