On Unix-like system building CPyMAD from source is most convenient and should be unproblematic.
On many distributions all Dependencies can be installed from the official repositories.
Download the MAD-X source from SVN
svn co http://svnweb.cern.ch/guest/madx/trunk/madX
Build and install the library
mkdir build && cd build
cmake -DMADX_STATIC=OFF -DBUILD_SHARED_LIBS=ON ../madX
make && make install
The install step might require root privileges if not changing the installation prefix.
The latest CPyMAD release can conveniently be installed using pip:
pip install cern-cpymad
If you run into problems with this, you should manually download and install the CPyMad source to see in which step the problem occurs:
git clone git://github.com/pymad/cpymad
cd pymad
python setup.py build
python setup.py install
You might need root privileges for the last step if not installing to a virtualenv.