|
| 1 | +# Setting Up Your Environment with uv |
| 2 | + |
| 3 | +This guide will walk you through installing `uv` (the fast Python package installer and resolver) and creating a Python virtual environment for Evolution Gym and related packages. |
| 4 | + |
| 5 | +## Installing uv |
| 6 | + |
| 7 | +### For Windows |
| 8 | +Open PowerShell and run: |
| 9 | +```powershell |
| 10 | +powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" |
| 11 | +``` |
| 12 | + |
| 13 | +### For macOS and Linux |
| 14 | +```bash |
| 15 | +curl -LsSf https://astral.sh/uv/install.sh | sh |
| 16 | +``` |
| 17 | + |
| 18 | +After installation, restart your terminal or reload your shell configuration to ensure the `uv` command is available. |
| 19 | + |
| 20 | +## Step-by-Step Environment Setup |
| 21 | + |
| 22 | +### 1. Initialize uv |
| 23 | +```bash |
| 24 | +uv init |
| 25 | +``` |
| 26 | +This initializes uv in your current directory. |
| 27 | + |
| 28 | +### 2. Create a Virtual Environment |
| 29 | +```bash |
| 30 | +uv venv python=python3.10 |
| 31 | +``` |
| 32 | +This creates a virtual environment using Python 3.10. |
| 33 | + |
| 34 | +### 3. Install Required Packages |
| 35 | +Run the following commands to install all necessary packages: |
| 36 | + |
| 37 | +```bash |
| 38 | +uv add evogym |
| 39 | +uv add ipykernel -U --force-reinstall |
| 40 | +uv add torch |
| 41 | +uv add matplotlib |
| 42 | +uv add --upgrade setuptools |
| 43 | +uv add tqdm |
| 44 | +uv add imageio |
| 45 | +``` |
| 46 | + |
| 47 | +### Package Details |
| 48 | + |
| 49 | +- **evogym**: Evolution Gym framework |
| 50 | +- **ipykernel**: Kernel for Jupyter notebooks |
| 51 | +- **torch**: PyTorch machine learning library |
| 52 | +- **matplotlib**: Data visualization library |
| 53 | +- **setuptools**: Package development tools |
| 54 | +- **tqdm**: Progress bar utility |
| 55 | +- **imageio**: Library for reading and writing image data |
| 56 | + |
| 57 | +## Activation and Usage |
| 58 | + |
| 59 | +### For Windows |
| 60 | +```powershell |
| 61 | +.venv\Scripts\activate |
| 62 | +``` |
| 63 | + |
| 64 | +### For macOS/Linux |
| 65 | +```bash |
| 66 | +source .venv/bin/activate |
| 67 | +``` |
| 68 | + |
| 69 | +After activation, you can start using the installed packages in your Python scripts or Jupyter notebooks. |
| 70 | + |
| 71 | +For any issues with the environment setup, check the [uv documentation](https://github.com/astral-sh/uv) or package-specific resources. |
0 commit comments