In this tutorial you will be guided through the installation of PyCA, a small library that streamlines the implementation of interactive artificial life models.
If you are comfortable with git
, you can simply clone the repository with git clone <https://github.com/frotaur/pyca
> .
If not, navigate to the PyCA github repo and download the full code of the project, and unzip it :
Open the project in your favorite IDE. At this point, it is recommended to create a virtual environment/ a conda environment, to isolate all the dependencies we will install.
FOR WINDOWS PC WITH GPUS : If you are running windows, and have a NVIDIA GPU, please run the following command before proceeding : pip3 install torch torchvision --index-url <https://download.pytorch.org/whl/cu126
>. This is to install torch with CUDA capability, as ‘pip install torch’ will only install CPU capabilities. If this fails somehow, it is probably due to the CUDA version, so visit https://pytorch.org/ and choose an earlier version. Linux and Mac users can safely skip this step.
To install pyca and all dependencies, simply run pip3 install -e .
from withing the pyca
folder, with the venv activated.
NOTE : it is technically possible to run torch with AMD gpus, but the code was untested in this case, so you are on your own !
To test that everything works correct, run python3 simulate.py -d cpu
. It could take some time to launch the first time, but a window should open, looking like this. :
If you have an Nvidia GPU, you can test with python3 simulate.py -d cuda
. This should open the same window if everything works correctly.
Note : while the program runs when choosing ‘mps’ as device (the Mac’s graphic acceleration), it unfortunately behaves very differently in Pytorch. As such, we recommended sticking with ‘cpu’ in this case, as many automata break/act differently with device=’mps’.