How to install swig

less than 1 minute read

Swig is the abbreviation of Simplified Wrapper and Interface Generator, it can give script language such as python the ability to invoke C and C++ libraries interface method indirectly.


Debian-based (Debian, Ubuntu, Mint, etc…)

sudo apt-get update
sudo apt-get swig

RPM-based (Red Hat Linux, CentOS, Fedora, openSuse, Mandrake Linux)

sudo yum update
sudo yum install swig


  1. Download SWIG from

  2. Unzip the downloaded pack.

  3. Run swig.exe file and follow the steps.


  1. In the command line, type:
     brew update
     brew upgrade
     brew install swig
     brew cleanup



Leave a comment