-
Notifications
You must be signed in to change notification settings - Fork 9
pyCSAMT installation guide for Windows and Linux
This guide explains how to install pyCSAMT on a Windows 10 system using Anaconda GUI and Anaconda Prompt.
- Can find Anaconda Python 3.7 from https://www.anaconda.com/distribution/ and install it.
noteTo use the full functionality of pyCSAMT, it's better to set a new environment to avoid conflicts of packages. Indeed, pyCSAMT can successfully run with basics python sub-packages especially when working without a modeling subpackage. However, when the modeling package is called, pyCSAMT will automatically install MTpy'toolkit
with its required dependencies like geopandas, netcdf, pyyaml, gdal and libgdal. Therefore, it's recommended to create a new environment.
Install pycsamt
using a terminal (Anaconda Prompt) or an anaconda GUI or depends on which platform you feel comfortable with. The installation can also be completed using an Anaconda Prompt.
- you first need to create a new environment using
conda create --name pycsamt
- then activate the environment using
conda activate pycsamt
Install required packages are not compulsory if you are already MTpy
installed in your computer or if you are sure to not use the modeling module :
But if your desired to use all functionalities, follow the the steps below and type:
conda install mtpy
- conda install
gdal libgdal geopandas netcdf4 pyyaml
-
pip install obspy
# Not necessary especially when you want to use some main features ofmtpy
by callingmtpy
frompycsamt
environment
Note: It's also possible to skip the installation of the required sub-packages above the first time. And after pycsamt
was installed, you may run the modeling subpackage and all required packages will be installed automatically as a subprocess.
After the steps above are carried out successfully :
- change your directory to the location where you want
pycsamt
code to be cloned to the Anaconda terminal (like a Windows command prompt) - type
DRIVE_LETTER:
to change to the appropriate drive andcd path\to\directory
to change directories. - Run the command
git clone https://github.com/WEgeophysics/pyCSAMT
- Once cloned, move into the cloned pyCSAMT directory with
cd pyCSAMT
Creating a new environment with Anaconda GUI following steps below.
- After installing Anaconda, open the Anaconda Navigator app
- In the left sidebar, select Environments, then at the bottom of the window select Create
- Give your new environment a suitable name and select Python 3.7 as the package, then press the green Create button to confirm:
If you want to install mtpy
manually as additional dependency, follow the following step below or click on the link to MTpy installation guide to see full of MTpy installation:
- select the environment you have created from the list of available environments and in the packages window to the right,
- select Not installed from the drop-down and enter
mtpy
in the search field - Select also the checkboxes next to
gdal
andlibgdal
, then click the Apply button in the lower right corner and a window will display confirming dependencies to install, - click Apply
Repeat the process for the following additional packages:
geopandas
,netcdf4
andpyyaml
.
it's possible to run pycsamt
in Anaconda Navigator from within the new environment created. The example below shows the effectiveness to run pycsamt
on Spyder through Anaconda Navigator but it's also effective to run with PyCharm, etc.
Version 18.04 of Unbutu can be downloaded here and more used than Ubuntu 20.4. These instructions have been tested with Ubuntu version 18.04, however, if you are using a different distribution, the name of your package manager may be different as well as available package versions.
pycsamt
can be installed on Linux with Anaconda to handle OS dependencies for you and actually, pycsamt
have not been tested yet on Linux without Anaconda. If you use a GUI desktop environment with your Linux OS, then you can download Anaconda for your OS (https://www.anaconda.com/distribution/) and follow the Anaconda GUI instructions above.
If you use the terminal by running the Ubuntu server, follow these instructions:
Visit https://repo.anaconda.com/archive/ to find the latest or desired Linux install script (e.g. Anaconda3-2020.02-Linux-x86_64.sh)
- download the script with
curl -O https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
(Adjusting script with your current version) - run the script with
./Anaconda3-2020.02-Linux-x86_64.sh
- create a new environment using
conda create --name pycsamt
- activate the environment using
conda activate pycsamt
- install required dependancies:
- conda
install mtpy gdal libgdal geopandas netcdf4 pyyaml
The following instructions are to install pycsamt
- Change directory to the location where you want the
pycsamt
code to be cloned - Run the command
git clone https://github.com/WEgeophysics/pyCSAMT
- Once cloned, move into the cloned
pyCSAMT
directory withcd pycsamt
When using PyPI release, an additional step is required (thin now, you may skip this part)
- Run the command
pip install .
- This command installs the
pycsamt
code as a package in your created Python environment.
A PyPi release of pyCSAMT is also available and can be installed using:
pip install pycsamt
-
pip install --user pycsamt
(for Window user)
However, it is recommended to install from the repository to get the latest development code.
Useful links to writing your own wiki pages:
- For documenting your project on GitHub: https://guides.github.com/features/wikis/)
- For editing wiki content: https://docs.github.com/en/communities/documenting-your-project-with-wikis/editing-wiki-content
- For adding images to wikis: https://help.github.com/articles/adding-images-to-wikis/