Installation¶
The installation of AgentSociety can be completed through pip:
pip install agentsociety
More Packages
The community extensions and benchmarking tools for AgentSociety can be installed with the following command:
pip install agentsociety-community agentsociety-benchmark
If you need to install a specific version, you can check the historical versions on PyPI and use the installation method for the specified version (taking version 1.3.7 as an example):
pip install "agentsociety==1.3.7"
Note
The Python package for AgentSociety does not distinguish between operating systems and architectures. Please ensure that the runtime environment meets the requirements in Prerequisites, otherwise errors will occur during execution.
Preparation Before Use¶
After completing the installation of AgentSociety, you can enter the agentsociety command in the command line to check if the installation was successful. If the following content appears, the installation is successful:
Usage: agentsociety [OPTIONS] COMMAND [ARGS]...
AgentSociety CLI tool
Options:
--version Show the version and exit.
-h, --help Show this message and exit.
Commands:
check Pre-check the config
run Run the simulation
ui Launch AgentSociety GUI
According to the command line prompt, AgentSociety provides the following subcommands:
check: Check if the configuration file is correct (corresponds to Code Usage)run: Run social simulation experiments (corresponds to Code Usage)ui: Start the WebUI interface of AgentSociety (corresponds to Using the Visual Interface)
Note
Both configuration files and map files for AgentSociety support YAML and JSON formats. All content in this document uses YAML format as an example.
In addition, AgentSociety needs to prepare map files. The map files use the map file format within MOSS: MObility Simulation System to describe roads, buildings, points of interest, etc. in the city.
Tip
We provide map files for some large cities, which can be downloaded from the Map Page on the AgentSociety Official Website.