Cornac supports most versions of Python 3. If you have not done so, go to the official Python download page.
There are 3 different ways in which you could install cornac. Depending on your environment and requirements, choose and run the corresponding codes to install Cornac:
Pip is a package manager for Python. It allows users to easily install, update, and manage third-party libraries and frameworks that are available on the Python Package Index (PyPI).
pip3 install cornac
Conda is an open-source package management system and environment management system for installing, creating, and managing software environments on Windows, macOS, Linux, and other operating systems.
conda install cornac -c conda-forge
3. From GitHub source - For latest updates#
Should you require the latest updates of Cornac from GitHub, you could manually build and install using the following codes:
pip3 install git+https://github.com/PreferredAI/cornac.git
Certain models in Cornac may require additional dependencies. The requirements.txt file shows what dependencies are required for each model.
Take the model WMF for example.
In order to utilize this model, this dependency needs to be installed. To install all dependencies in a provided requirements.txt file, follow these steps:
Using your favourite terminal/command prompt, navigate to the models in which you want to utilize
Install the dependencies by using this command:
pip3 install -r requirements.txt
Note for MacOS users
Some algorithm implementations use OpenMP to support multi-threading. For MacOS users, in order to run those algorithms efficiently, you might need to install gcc from Homebrew to have an OpenMP compiler:
brew install gcc | brew link gcc
After installing Cornac, you can verify that it has been successfully installed by running the following command on your favourite terminal/command prompt:
python3 -c "import cornac; print(cornac.__version__)"
You should see the following output:
Congratulations! Your machine has Cornac and you’re now ready to create your first experiment!
Start creating your first experiment by following the Quickstart guide.