Skip to content

MTPy installation guide for Linux system

Fei Zhang edited this page Oct 1, 2018 · 20 revisions

Introduction

MTPy package can be run in any Python2.7 as long as the required dependency packages are installed. However, we recommend use Anaconda Python distribution because of its many features including strong scientific flavor and free availability. No admin privilege is required to install the Anaconda Python software packages.

This wiki page will be focused on Anaconda Python installation for MTPy in Linux. (If you use Windows PC, please see the installation guide for Windows.

How to install Anaconda Python on Linux

(As mentioned already, no admin privilege is required)

The instruction is tested on Ubuntu Linux Version-18.04, and should be similar in other flavours of Linux systems.

  1. obtain the installation package by download from https://www.anaconda.com/download/#linux

OR

mtpy@mtpy-VirtualBox$ wget https://repo.anaconda.com/archive/Anaconda2-5.2.0-Linux-x86_64.sh

Saving to: 'Anaconda2-5.2.0-Linux-x86_64.sh’

Anaconda2-5.2.0-Linux-x86_64.sh 100%[=============================================>] 603.38M 209KB/s in 53m 32s

  1. chmod 755 Anaconda2-5.2.0-Linux-x86_64.sh¶

  2. installation on command-line mtpy@mtpy-VirtualBox$ chmod u+x Anaconda2-5.2.0-Linux-x86_64.sh

mtpy@mtpy-VirtualBox$ ./Anaconda2-5.2.0-Linux-x86_64.sh

Welcome to Anaconda2 5.2.0

In order to continue the installation process, please review the license agreement. Please, press ENTER to continue

Accept the license and let it install into default directory location (/home/mtpy/anaconda2). This process will take a couple of minutes to complete. In the end when prompted, enter yes to make the new ananconda python PATH available by appending automatically a line of configuration into your $HOME/.bashrc, with output shown below:

[no] > yes

Appending source /home/mtpy/anaconda2/bin/activate to /home/mtpy/.bashrc A backup will be made to: /home/mtpy/.bashrc-anaconda2.bak

For this change to become active, you have to open a new terminal.

Thank you for installing Anaconda2!

===========================================================================

Anaconda is partnered with Microsoft! Microsoft VSCode is a streamlined code editor with support for development operations like debugging, task running and version control.

To install Visual Studio Code, you will need:

Administrator Privileges Internet connectivity Visual Studio Code License: https://code.visualstudio.com/license

Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]

no

After the successful installation of anaconda python, open a new terminal and test to make sure your default python interpreter is /home/mtpy/anaconda2/bin/python, not your OS-provided python (/user/bin/python):

  1. Install additional dependency python packages: or gdal, pandas, geopandas and netcdf4 data handling:

conda install geopandas -y

conda install netcdf4 -y

Configure GDAL_DATA properly by appending in $HOME/.bashrc

export GDAL_DATA=/home/mtpy/anaconda2/share/gdal

(one way to do this is: echo 'export GDAL_DATA=/home/mtpy/anaconda2/share/gdal' >> /home/mtpy/.bashrc)

  1. Clone Install mtpy package using git If git command is not installed, do

sudo apt install git

Obtain the mtpy source code:

git clone https://github.com/MTgeophysics/mtpy

Oracle VirtualBox to run Linux on Windows or Mac

An alternative way to get a Ubuntu Linux system is to use Oracle VirualBox, freely downloadable from https://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html.

After install VirtualBox,the user can create a virtual guest OS such as Ubuntu-18.04.

Note: In the workshop, we plan to provide an Oracle Virtual Appliance (Ubuntu1804-mtpy.ova),which is a file of 4GB in size, and can be directly imported into your VirtualBox. It contains all materials and installation required for Workshop, so that you will be able to run the Workshop material without installing anything else.

Clone this wiki locally