Skip to content

Instantly share code, notes, and snippets.

@spk921
Forked from ronrest/Install Mayavi on Ubuntu
Last active January 12, 2018 22:13

Revisions

  1. spk921 revised this gist Jan 12, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Install Mayavi on Ubuntu
    Original file line number Diff line number Diff line change
    @@ -39,6 +39,8 @@ ln -s /usr/lib/pymodules/python2.7/vtk vtk


    echo "INSTALLING MAYAVI"

    sudo apt-get install python-dev
    pip install mayavi

    echo "INSTALLING GUI BACKEND FOR MAYAVI"
  2. @ronrest ronrest created this gist Mar 31, 2017.
    47 changes: 47 additions & 0 deletions Install Mayavi on Ubuntu
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    #!/bin/bash

    # MAYAVI SETUP
    # mayavi is a python library for scientific visualisations, that can handle
    # visualisation of Lidar Data. But, it can also be used to project Lidar data
    # to 2D images.
    #
    # The set of commands I used to get mayavi set up on my computer so far.
    # NOTE: I still do not know if it is set up properly, so this set of steps
    # might be incomplete.
    # NOTE: python-vtk is a prerequisite of mayavi, but it only seems to be
    # available for python 2.7
    # NOTE: This setup assumes that a virtualenv called `tfcv` has been used to
    # install the python libraries. You should modify the
    # VIRTUAL_ENV_NAME, and VIRTUAL_ENV_ROOT to where you have your desired
    # virtualenv located, or, remove any lines that mentions virtualenv
    # if you are not using a virutalenv.

    PYTHON_VERSION="2.7" #
    VIRTUAL_ENV_NAME="tfcv" # Name of your virtualenv
    VIRTUAL_ENV_ROOT="${HOME}/virtualenvs" # Where your virtual envs are stored

    # REMOVE THE FOLLOWING 2 LINES IF YOU ARE NOT USING A VIRTUALENV
    echo "ENTERING VIRTUALENV"
    . ${VIRTUAL_ENV_ROOT}/${VIRTUAL_ENV_NAME}/bin/activate


    echo "================================================"
    echo "INSTALL LIBRARIES FOR PROCESSING POINT CLOUD DATA"
    echo "================================================"

    echo "INSTALLING VTK" # Prerequisite for mayavi
    sudo apt-get install -y python-vtk

    # REMOVE THE FOLLOWING 3 LINES IF YOU ARE NOT USING A VIRTUALENV
    # CREATE LINK TO THE VTK FILES FROM THE VIRTUALENV
    cd ${VIRTUAL_ENV_ROOT}/${VIRTUAL_ENV_NAME}/lib/python2.7/site-packages/
    ln -s /usr/lib/pymodules/python2.7/vtk vtk


    echo "INSTALLING MAYAVI"
    pip install mayavi

    echo "INSTALLING GUI BACKEND FOR MAYAVI"
    #pip install mayavi[TraitsBackendQt]
    sudo apt-get install build-essential git cmake libqt4-dev libphonon-dev python2.7-dev libxml2-dev libxslt1-dev qtmobility-dev libqtwebkit-dev
    pip install pyside