-
Notifications
You must be signed in to change notification settings - Fork 54
Installing pygslib with conda
Pygslib is distributed as a conda package and is available for Windows, Linux and macOS. It supports 64 bits Python 3.6 and 2.7. Python 3.7 is not supported yet because vtk, a key dependency of pygslib, is not available in conda-forge or in anaconda cloud for this python version.
This is the fastest and easier way to install pygslib for user without other python distributions, including pre-existing Anaconda or Miniconda installations.
-
Go to https://conda.io/miniconda.html and download Miniconda:
- for MS Windows users https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe
- for Linux users https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
- for Mac OS users https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
Execute the installer and follow the instructions until you get this window.
Check the option of adding anaconda to the path if you want to get better access to the program from anywhere in your computer and you don't have another "important" python distribution. This will facilitate a lot of the work with python.
-
Downgrade Python to the version 3.6
This Miniconda distribution comes with Python 3.7 but pygslib only supports Python 3.6 and you will need to downgrade Python. Open a terminal and type:
conda install python=3.6
and pressenter
press
y
andenter
when requested.The entire process will take few minutes
-
Install PyGSLB
Now you are ready to install pygslib, just type (or copy and paste)
conda install pygslib -c opengeostat -c conda-forge
in the terminal and pressenter
press
y
andenter
when requested and conda will download and install pygslib and its dependencies and the dependencies of the dependencies, this may be a long list. -
Testing the installation
At this point we recommend using Chrome, Safari, or Firefox as default browser, IE explorer is not supported and is problematic...
Download this demo and unpack the file into a working directory, for example
~/Desktop/Demo1
.Open a terminal inside this directory, for example by typing
cmd
in the address bar of he windows explorer, as shown in the image below.Then, type in the terminal the command
jupyter notebook
.Note: Here we are assuming that you have already Jupyter, if not please install it using the command
conda install jupyter
and try again.This will open a Jupyter Notebook dashboard in your browser
Click on
Demo small version.ipynb
to open the example and click on Cell/Run All.This will run a mineral resource estimate.
Scroll down to make sure that all cells were executed. The last cell (In [30]:) may look like this:
If you get an error please describe it here:
You may need Paraview to visualize drillholes and block models, it is available at https://www.paraview.org/download/
Just install the program, open it, and drag and drop files with extension *.vtu
and *.vtp
generated in the example above to generate visualizations like this one.
To see if you have a conda distribution open a terminal (linux/macOS) or a command prompt (windows) and type any of the commands
where conda
which conda
conda info
conda list
conda list --envs
To check what version of python you have just type python, for example:
c:\>python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
This is a good option if you already have Anaconda or Miniconda with a non-compatible Python version. A virtual environment is just an isolated python installation where you can safely install new python packages without breaking dependencies.
To create a python environment open a terminal and type
conda create -n py3.6 python=3.6
To use the environment in windows type
conda activate py3.6
In Linux or macOS
conda source activate py3.6
You will see something like this
(py3.6) C:\Users\AMartinez\Desktop\Demo1\>
here the environment active is shown in parenthesis, in this case (py3.6)
For more information on virtual environments visit https://conda.io/docs/user-guide/tasks/manage-environments.html
To install pygslib use the command, as shown above
conda install pygslib -c opengeostat -c conda-forge
pygslib will be installed in the environment active or in the default conda distribution if no environment is active.
Note that conda-forge channel is required to get the package dependency ezdxf
.
Conda will install and upgrade pygslib dependencies:
- python
- numpy
- pandas >=0.17
- matplotlib
- scipy
- vtk >=7.1
- ipython
- colour
- bokeh
- ezdxf