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

OR

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

2) Change permission to run

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

3) Run the installation script on command-line

  • ./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!

=========================================================================== 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):

4) 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)

5) Clone and install mtpy package using git

If git command is not installed, do

  • sudo apt install git

Obtain the mtpy source code:

See the README page for more tips.

start jupyter-notebook and test run this

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