Installation

Pip Wheels and Conda packages are both available for Python 3.7 and 3.8 on the Windows 64bits plateform. If you need to use PyHELP with a version of Python other than 3.7 or 3.8, or if you are working on Linux or macOS, you will have to build and install PyHELP from source.

Install with Conda

Warning

This installation method is currently only supported for the Windows 64bits plateform.

The easiest method to install a released version of PyHELP on Windows is with Conda. To do so, you will need first to download and install the Anaconda distribution on your computer. Anaconda comes with the most important Python scientific libraries (i.e. Numpy, Pandas, Matplotlib, IPython, etc), including all PyHELP dependencies, in a single, easy to use environment. It also includes the Anaconda Navigator, which is a graphical user interface to the Conda package and environment manager.

First, to avoid installation problems and dependency conflicts, we advise you to install PyHELP in a fresh new conda environment. This can be done with the Anaconda Navigator or with Conda by executing the following command in a terminal:

conda create -n my_new_env_name python=3.8.*

If you want to use Python 3.7 instead, simply replace the python=3.8.* argument by python=3.7.*.

Then, PyHELP can be installed, along with all its dependencies, by executing the following command in a terminal:

conda install -c cgq-qgc pyhelp

When a new released version of PyHELP is made available on the Anaconda cgq-qgc channel, PyHELP can be updated by executing the following command in a terminal:

conda update -c cgq-qgc pyhelp

If you need more guidance on how to install packages or manage Conda environments with Conda or the Anaconda Navigator, please consult the Getting started with conda or Getting started with Navigator guide.

Install with Pip

Warning

This installation method is currently only supported for the Windows 64bits plateform.

It is also possible to install PyHELP with pip, but be aware that pip installations are for advanced users.

First, you will need to download and install Python 3.7 or 3.8 on your computer.

Then, you can install PyHELP with pip by executing the following command in a terminal:

python -m pip install pyhelp

Install PyHELP from source

If you need to use PyHELP with a version of Python other than 3.7 or 3.8, or if you are working on Linux or macOS, you will have to build and install PyHELP from source. Below is a step-by-step guide that describe how to achieve this.

  1. Install PyHELP’s requirements.

    The recommended and easiest way to do this is with Anaconda, a free and open source distribution of Python. If you decide to do so, PyHELP’s requirements can be installed one by one with the Anaconda Navigator or with Conda by executing the following command in a terminal:

    conda install scipy geopandas xlrd netcdf4 h5py pytables matplotlib
    
  2. Install Git, a powerful source control management tool, or install one of the numerous GUI client that exists for it .

  3. Clone the PyHELP source code repository by running this command :

    git clone https://github.com/cgq-qgc/pyhelp.git <path-to-target-dir>
    

    or do it with your GUI client if you are using one.

  4. Build and install PyHELP by executing the following commands in a terminal from inside your cloned directory:

    python setup.py build_ext
    python setup.py install
    

    To do the above, you will need to have a Fortran and C++ compiler installed on your computer. If you are using Anaconda, you can achieve that simply by installing the conda package named m2w64-toolchain. If you do not use Anaconda and are working on Linux or macOS, you can install the free and open source GNU Compiler Collection (GCC) and the GNU Fortran compiler (gfortran) with the package manager of your operating system. If you are on Windows, you can download and install mingw-w64, which is a complete runtime environment for gcc to support binaries native to Windows 64-bit and 32-bit operating systems.

  5. Open Python and start using PyHELP.

  6. To keep your PyHELP repository up-to-date, run git pull inside the cloned directory or do it with your GUI client. You then need to re-build and re-install PyHELP, so that the pulled changes are applied to the PyHELP installation used by your Python installation.