mesuga-reymond / installation_guide_of_things

Installation guide of things in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation Guide of Things

Contents

  1. How to Install Conda from Linux Terminal
  2. How to Set Up a Conda Environment
  3. GDAL For Windows (outside conda environment)
  4. GDAL For Windows (inside conda environment)
  5. GDAL for Linux (inside conda environment)
  6. Rasterio (inside conda environment)

How to Install Conda from Linux Terminal

To install conda from linux terminal, run the following highlighted commands separately:
  • wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh (This one is miniconda for 64-bit OS but you can also pick the conda installer of your choice in this link.)
  • bash Miniconda3-py39_4.12.0-Linux-x86_64.sh
That's it.

How to Set Up a Conda Environment?

A virtual environment like conda helps us to create isolated spaces to keep the versions of packages of a specific project. To create a conda environment use the command:
conda create --name your_conda_env_name python=insert_version
For linux, to prepare bash environment for use of command conda activate anywhere, use the following command:
conda init bash
To activate the created conda environment use
conda activate your_conda_env_name
To install a package a package, use any of the following command:

  • conda install package_name (From official Anaconda distribution)
  • conda install --channel=conda-forge package_name (From conda-forge channel often contains the latest version of a package)
  • pip install package_name (From PyPI, a package repository of open-source Python libraries. To make use of pip commands inside conda use conda install pip)
To deactivate or get out of the created conda environment use
conda deactivate

GDAL For Windows (outside conda environment)

STEP 1: Go to this Link and select the package suited for your architecture. Select the msi installer of GDAL according to the version of python in your environment. Also, choose the insaller with description Installer for the GDAL python bindings (requires to install the GDAL core).

STEP 2: Install GDAL through the downloaded msi installer.

STEP 3: Check the version of the installed GDAL using the command gdalinfo --version. Remember the version.

STEP 4: Go to command prompt and run the following seperately:

  • setx PATH "%PATH%;C:\Program Files (x86)\GDAL"
  • setx PATH "%GDAL_DATA%;C:\Program Files (x86)\GDAL\gdal-data"
  • setx PATH "%GDAL_DRIVER_PATH%;C:\Program Files (x86)\GDAL\gdalplugins"
  • setx PATH "%GDAL_VERSION%;insert_gdal_version_here"
NOTE: The above commands are for 32-bit Windows. For 64-Bit, just remove the (x86). Don't forget to remove the space before (x86).

GDAL For Windows (inside conda environment)

STEP 1: Run the command conda install -c conda-forge gdal

STEP 2: Check the version of the installed GDAL using the command gdalinfo --version. Remember the version.

STEP 3: Go to command prompt and run the following seperately:

  • setx PATH "%PATH%;C:\Program Files (x86)\GDAL"
  • setx PATH "%GDAL_DATA%;C:\Program Files (x86)\GDAL\gdal-data"
  • setx PATH "%GDAL_DRIVER_PATH%;C:\Program Files (x86)\GDAL\gdalplugins"
  • setx PATH "%GDAL_VERSION%;insert_gdal_version_here"
NOTE: The above command is for 32-bit Windows. For 64-Bit, just remove the (x86). Don't forget to remove the space before (x86).

GDAL for Linux (inside conda environment)

To install gdal, use any of the following commands:
conda install -c conda-forge gdal or
pip install GDAL

Rasterio (inside conda environment)

STEP 1: Install GDAL using guide above.
STEP 2: Run the following command individually:
  • conda install -c conda-forge fiona
  • conda install -c conda-forge pyproj
  • conda install -c conda-forge shapely
  • conda install -c conda-forge rasterio

About

Installation guide of things in Python