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 |
|
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 4 |
|
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 |
|
If you use conda, you can update lidar to the latest version by running the following command in your terminal:
1 |
|
To install the development version from GitHub directly using Git, run the following code:
1 |
|
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 information 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 |
|
If you encounter any compiling errors, try the following commands.
1 2 3 |
|
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 |
|
macOS¶
For a Homebrew based Python environment, do the following.
1 2 |
|
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 4 |
|
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 information 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