Conan can be installed in many Operating Systems. It is extensively used and tested in Windows, Linux (different distros), OSX, and also actively used in FreeBSD and Solaris SunOS, but it has been reported to work in other systems too.
There are three ways to install conan:
- The preferred and strongly recommended way to install conan is from PyPI, the Python Package Index,
- There are other available installers for different systems, which might come with a bundled python interpreter, so it is not necessary to install python first. Please note that some of these installers might have some limitations, specially those created with pyinstaller (like Windows exe & Linux deb).
- Running conan from sources.
Install with pip (recommended)¶
You need a python 2.7 or 3.X distribution installed in your machine. Modern python distros come with pip pre-installed, if not, install pip following pip docs
$ pip install conan
IMPORTANT: Please READ carefully:
- Please make sure that your pip installation matches your python (2.7 or 3.X) one.
- In Linux if you want to install it globally, you might need sudo permissions.
- We strongly recommend using virtualenvs (virtualenvwrapper works great) for everything python related
- In Windows you might need to use 32bits python distributions, instead of 64bits.
- In OSX, specially latest versions that might have System Integrity Protection, pip might fail. Try with virtualenvs, or install with other user
$ pip install --user conan
- If you are in Windows, and using python <3.5, you might have problems if python is installed in a path with spaces, like “C:/Program Files(x86)/Python”. This is a known python limitation, not conan. Install python in a path without spaces, use a virtualenv in another location or upgrade your python installation
- In some Linux distros, like Linux Mint, it is possible that you need a restart (shell restart, or logout/system if not enough) after installation, so conan is found in the path.
Install from brew (OSX)¶
There is a brew recipe, so in OSX, you can install conan with
$ brew update $ brew install conan
Install from AUR (Arch Linux)¶
You can find the package here. The easiest way is using pacaur tool:
$ pacaur -S conan
Or you can also use
makepkg and install it following the AUR docs: installing packages.
Just remember to install four conan dependencies first. They are not in the official repositories but there are in AUR repository too:
Install the binaries¶
Go to the conan website and download the installer for your platform!
Execute the installer. You don’t need to install python.
You can also use the latest version’s links to download the latest installer:
Let’s check if conan is correctly installed. Execute in your console:
You will see something similar to:
Conan commands. Type $conan "command" -h for help alias Creates and export an alias recipe build Utility command to run your current project 'conanfile.py' build() method. config Manages conan configuration information copy Copy conan recipes and packages to another user/channel. ...
Install from source¶
You can run conan directly from source code. First you need to install Python 2.7 and pip. From 0.9 conan has “experimental/testing” Python3 support too.
Clone (or download and unzip) the git repository and install its requirements:
$ git clone https://github.com/conan-io/conan.git $ cd conan $ pip install -r conans/requirements.txt
Create a script to execute conan and add it to your
#!/usr/bin/env python import sys conan_repo_path = "/home/your_user/conan" # ABSOLUTE PATH TO CONAN REPOSITORY FOLDER sys.path.append(conan_repo_path) from conans.client.command import main main(sys.argv[1:])
You should see the conan commands help.