Skip to content

Installation

lidar supports a variety of platforms, including Microsoft Windows, macOS, and Linux operating systems. Note that you will need to have Python 3.x (< 3.9) installed. Python 2.x is not supported. lidar is available on both PyPI and conda-forge. lidar has a GDAL dependency, which can be challenging to install using pip on Windows. Therefore, it is highly recommended to install lidar from the conda-forge channel. If you encounter any errors, please check the Dependencies section below.

Install from PyPI

To install lidar from PyPI, run this command in your terminal:

1
pip install lidar

Install from conda-forage

If you have Anaconda or Miniconda installed on your computer, you can create a fresh conda environment to install lidar:

1
2
3
conda create -n py38 python=3.8
conda activate py38
conda install lidar -c conda-forge

Upgrade lidar

If you have installed lidar before and want to upgrade to the latest version, you can run the following command in your terminal:

1
pip install -U lidar

If you use conda, you can update lidar to the latest version by running the following command in your terminal:

1
conda update lidar -c conda-forge

To install the development version from GitHub directly using Git, run the following code:

1
pip install git+https://github.com/giswqs/lidar

Dependencies

lidar's Python dependencies are listed in its requirements.txt file. In addition, lidar has a C library dependency: GDAL >=1.11.2. How to install GDAL in different operating systems will be explained below. More informaton about GDAL can be found here.

Linux

Debian-based Linux

The following commands can be used to install GDAL for Debian-based Linux distributions (e.g., Ubuntu, Linux Mint).

1
2
3
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install gdal-bin libgdal-dev

If you encounter any compiling errors, try the following commands.

1
2
3
sudo apt-get install --reinstall build-essential
sudo apt-get install python3-dev
pip install wheel

Pacman-based Linux

The following commands can be used to install GDAL for Pacman-based Linux distributions (e.g., Arch Linux, Manjaro). You might need to use sudo if you encounter permission errors.

1
2
3
sudo pacman -S yaourt --noconfirm
yaourt -S gdal --noconfirm
yaourt -S python-gdal --noconfirm

macOS

For a Homebrew based Python environment, do the following.

1
2
brew update
brew install gdal

Alternatively, you can install GDAL binaries from kyngchaos. You will then need to add the installed location /Library/Frameworks/GDAL.framework/Programs to your system path.

Windows

The instruction below assumes that you have installed Anaconda. Open Anaconda Prompt and enter the following commands to create a conda environment and install required packages

1
2
3
conda create -n py38 python=3.8
conda activate py38
conda install lidar -c conda-forge

When installing the lidar package, if you encounter an error saying Microsoft Visual C++ 14.0 is required, please follow the steps below to fix the error and reinstall lidar. More infomration can be found at this link Fix Python 3 on Windows error - Microsoft Visual C++ 14.0 is required.

  • Download Microsoft Build Tools for Visual Studio 2017
  • Double click to install the downloaded installer - Microsoft Build Tools for Visual Studio 2017.
  • Open Microsoft Build Tools for Visual Studio 2017
  • Select Workloads --> Visual C++ build tools and click the install button

Last update: 2021-07-10