-
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. The conda package only supports Python 3.8 (64 bits).
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 64 bits for Python 3.8
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.8
If Miniconda comes with Python version over 3.8 you will need to downgrade Python. Open a terminal and type:
conda install python=3.8
and pressenter
press
y
andenter
when requested.The entire process will take few minutes
it is recommended using virtual environments to avoid braking existing conda installations.
To create a virtual environment, use the commandconda create --name <your preferred env name> python=3.8
and activate it withconda activate <your preferred env name>
-
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 windows explorer, as shown in the image below.Then, type in the terminal the command
jupyter notebook
.Note: Here we are assuming that you already have 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.8 python=3.8
To use the environment in windows type
conda activate py3.8
In Linux or macOS
conda source activate py3.8
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.8)
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
- matplotlib
- scipy
- vtk
- ipython
- colour
- bokeh
- ezdxf