Install with pip (Recommended).
pip install lagent
Optionally, you could also build Lagent from source in case you want to modify the code:
git clone https://github.com/InternLM/lagent.git cd lagent pip install -e .