Skip to content

Instantly share code, notes, and snippets.

@ronrest
Created March 31, 2017 11:36
Show Gist options
  • Save ronrest/d778ee5d49c026ccee1dbec6bd5b3988 to your computer and use it in GitHub Desktop.
Save ronrest/d778ee5d49c026ccee1dbec6bd5b3988 to your computer and use it in GitHub Desktop.
#!/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
@RameshKamath
Copy link

RameshKamath commented Mar 15, 2018

Also, use sudo apt-get install python-pyqt4 for pyqt4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment