UPDATE: A better way… Installing Python with Anaconda
The approach used here to install Python is:
- First, we install Spyder (along with all the libraries that come with it)
- Then, we install additional libraries (than do not come with Spyder)
Spyder is a powerful interactive development environment (IDE) for the Python language… kinda’ a graphical (Matlab-looking) interface that allows you to easily write you Python code, run it, debug it, etc. Another nice thing… when installing Spyder, it automatically installs not only Python, but also a bunch of scientific libraries like NumPy, SciPy, Matplotlib and iPhyton.
Install Spyder in Linux (Ubuntu)
Install Spyder via Ubuntu Software Centre:
- Open the “Ubuntu Software Centre”
- Search for “spyder”
- Click install
- It should be installed under the “Scientific” menu
OR install Spyder via a terminal:
sudo apt-get install spyder
Install additional libraries
Basemap
You may be apble to search for “Basemap” in the software centre and click install… if not read below:
Instructions came from here: http://matplotlib.org/basemap/users/installing.html
- Download source tarballs here.
- Unpack, go into the directory and execute:
sudo python setup.py install
If it doesn’t work, execute the following:
cd geos-3.3.3 export GEOS_DIR=/usr/local ./configure --prefix=$GEOS_DIR sudo make sudo make install cd .. sudo python setup.py install
xlrd (read Excel files)
In “Ubuntu Software Centre”, search for “xlrd”. Click install.
Or… in terminal…
sudo apt-get install xlrd
h5py – Python interface to HDF5 file format
- Open “Software Centre”
- Search “h5py”
- Click install
Or… in terminal…
sudo apt-get install h5py
netcdf4-python
Instruction came from here: http://code.google.com/p/netcdf4-python/wiki/UbuntuInstall
First install HDF5
- Download the current HDF5 source release.
- Unpack, go into the directory and execute:
./configure --prefix=/usr/local --enable-shared --enable-hl make sudo make install
Download and install zlib library
- Download the current zlib.
- Unpack, go into the directory and execute:
./configure make sudo make install
Then install netCDF4
- Download the current netCDF4 source release.
- Unpack, go into the directory and execute:
LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include ./configure --enable-netcdf-4 --enable-dap --enable-shared --prefix=/usr/local make sudo make install
Finally, install netcdf4-python
- Download the current netcdf4-python source release
- Unpack, go into the directory and execute:
sudo ldconfig sudo python setup.py install