Skip to content

Installation

CS Goh edited this page Dec 22, 2022 · 23 revisions

Installation

Install from PyPI

pip install roadmapper

Upgrade to the latest version

If you are running older version of roadmapper, you can upgrade to the latest version by running the following command:

pip install --upgrade roadmapper

Test the installation

To verify that the installation works run the following Python code:

from roadmapper.roadmap import Roadmap
Roadmap.__version__
'v0.2.2'

Roadmapper has been tested on the following OSes:

  • Windows 11
  • Ubuntu 18.01
  • MacOS Ventura 13.0.1

Common installation error on Linux or MacOS

The following are common pycairo related problem when installing roadmapper on Linux machine:

Collecting pycairo
  Using cached pycairo-1.23.0.tar.gz (344 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pycairo
  Building wheel for pycairo (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pycairo (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/cairo
      copying cairo/__init__.py -> build/lib.linux-x86_64-cpython-310/cairo
      copying cairo/__init__.pyi -> build/lib.linux-x86_64-cpython-310/cairo
      copying cairo/py.typed -> build/lib.linux-x86_64-cpython-310/cairo
      running build_ext
      Package cairo was not found in the pkg-config search path.
      Perhaps you should add the directory containing `cairo.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'cairo' found
      Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycairo
Failed to build pycairo
ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects

To resolve this on Ubuntu, install the pycairo library dependencies first as below:

$ sudo apt update
$ sudo apt install libcairo2-dev pkg-config python3-dev

To resolve this on MacOS, install the pycairo library dependencies first as below:

$ brew install cairo pkg-config

Once you have installed the dependencies, you are good to install roadmapper.

Clone this wiki locally