Welcome to the comprehensive installation guide for Animal-AI. This guide is tailored for users who may not be familiar with Python dependencies, navigating GitHub repositories, or working with Unity. It's also here to help you smoothly navigate through any installation hiccups – because let's face it, it's custom software installation... when isn't there a hiccup or two?.
For Windows Users: This guide is primarily written with Windows users in mind. We've tried to make it as straightforward as possible, so you can get started with Animal-AI without any hassle.
For Mac and Linux Users:
Similarly for Mac, most of the instructions for Windows users should still apply to you. If you are using MacOS, you may also need to run this command: chmod -R 777 AnimalAI.app
in your MacOS terminal to unlock permissions for running the application.
If you're a Linux user, you're likely more comfortable with command-line interfaces and installations. Please note that if you are using Linux, you may need to make the .exe file executable: Simply run this command in your terminal: chmod +x env/AnimalAI.x86_64
. Please also make sure that when you extract the folder, you move the files inside the sub-directory to its parent folder.
- Download Python: Obtain Python 3.9.x from Python's official website.
- Run the Installer: Follow the installation instructions. Ensure to add Python to your PATH (via the checkbox). Note: if you're doing a custom intallation, it is recommended to keep the
install pip
box ticked and usepip
to install dependencies. - Check Installation: Open a Command Prompt terminal and run
python --version
. You should see the version you installed. Make sure it's Python 3.9.x. - Check Pip: Run
pip --version
to see if pip is installed. If it's not, you can install it by runningpython -m ensurepip
in the terminal. If you're using Python 3.4 or later, pip is included by default. - Check PATH: Run
echo %PATH%
in the terminal to see if Python is added to your PATH. If it's not, you can add it manually by following the instructions here.
Note: This step is only necessary if you wish to contribute to Animal-AI. If you only want to use the environment, you can skip this step and go to step 3.
- Prepare a Directory: Create a root folder for the AnimalAI project for better organization.
- Clone the Repository: Options include:
- Downloading the
.zip
file from Animal-AI GitHub and extracting it. - Using GitHub Desktop for direct cloning.
- Cloning via the GitHub CLI.
- Downloading the
- Check: The root folder should contain the
animal-ai
folder.
- Creating a Virtual Environment: Useful for managing dependencies.
- Python: Use
python -m venv your_env_name
and activate it in theScripts
directory withactivate
. - Conda: Use
conda create --name your_env_name
and activate withconda activate your_env_name
.
- Python: Use
For more information on virtual environments, refer to the Python Documentation or Conda Documentation.
- Navigate to the Repository: Go to
animal-ai
. - Install Dependencies:
- Using pip: Run
pip install animalai
. This will install the dependencies necessary to run Animal-AI, located in theanimalai
package from PyPI (Python Package Index). - Using Conda: Install pip (
conda install pip
), then runpip install animalai
. - Using a Virtual Environment: Activate your virtual environment, then run
pip install animalai
.
- Using pip: Run
- Check: Run
pip list
to see ifanimalai
is installed. You should obtain the latest version of the package automatically. If you require an older version, you can specify it withpip install animalai==x.x.x
wherex.x.x
is the version number.
- Download: Get the version for your OS from the
Releases
section in the repository here. - Extract: Unzip the downloaded folder into any destination of your choosing (we recommend to your Desktop). You can use WinRAR or 7-Zip to extract the files.
- Check: The folder should contain the
.exe
file for Windows,.app
file for MacOS, and the.x86_64
file for Linux.
You can now start using Animal-AI by launching the application for your OS, located in the directory where you extracted the folder. Note that Animal-AI does not need to be installed in your system to run.
Please see our Launching AAI guide for a step-by-step guide on how to start using Animal-AI.
Folder navigation in Windows is performed using the cd
command, e.g. if the current directory is shown as :C\Users\Name
and you want to go to your new Animal-AI root folder called "AAI", you would type cd AAI
and it will now show you are at :C\Users\Name\AAI
. To go to the parent directory (e.g. in this case :C\Users
), you would type cd..
and if your directory name contains spaces, use speech marks e.g. cd "AAI Folder"
. You can also use the dir
command to list the contents of the current directory, and dir /b
to list the contents without any additional information.
Everything you need to run scripts in Animal-AI (including the correct version of Unity's ml-agents
package) is found in the Python Index Package animalai
. This is installed using pip
or conda
as described above. The animalai
package is a Python wrapper for the Unity environment, and is the only dependency you need to install. The animalai
package is also the only dependency you need to import in your scripts, and it will import everything else you need from the animalai
package itself.
You can then start using Animal-AI! Any problems, please get in touch (ia424@cam.ac.uk / alhasacademy96) or post an issue on the GitHub repository.
Visit our FAQ page for more information on common issues and solutions here.