Installation¶
There are different ways to install segy
:
Building package from source.
Note
We strongly recommend using a virtual environment venv
or conda
to avoid potential conflicts with other Python packages.
Using pip
and virtualenv
¶
Install the 64-bit version of Python 3 from https://www.python.org.
Then we can create a venv
and install segy
.
$ python -m venv segy-venv
$ segy-venv/Scripts/activate
$ pip install -U segy
You can also install some optional dependencies (extras) like this:
$ pip install segy[cloud]
cloud
installs fsspec backed I/O libraries for AWS’ S3,
Google’s GCS, and Azure ABS.\
To check if installation was successful see checking installation.
Using conda
¶
segy
can also be installed in a conda
environment.
Note
segy
is hosted in the conda-forge
channel. Make sure to always provide the
-c conda-forge
when running conda install
or else it won’t be able to find
the package.
We first run the following to create and activate an environment:
$ conda create -n segy-env
$ conda activate segy-env
Then we can to install with conda
:
$ conda install -c conda-forge segy
The above command will install segy
into your conda
environment.
Note
segy
extras must be installed separately when using conda
.
Checking Installation¶
After installing segy
, run the following:
$ python -c "import segy; print(segy.__version__)"
You should see the version of segy
printed to the screen.
Building from Source¶
All dependencies of segy
are Python packages, so the build process is very simple.
To install from source, we need to clone the repo first and then install locally via pip
.
$ git clone https://github.com/TGSAI/segy.git
$ cd segy
$ pip install .
We can also install the extras in a similar way, for example:
$ pip install .[cloud]
If you want an editable version of segy
then we could install it with the command below.
This does allow you to make code changes on the fly.
$ pip install --editable .[cloud]
To check if installation was successful see checking installation.