Installation ======================== .. sidebar:: Installation Everything you need to know to start using SpaceSense’s library. .. note:: We highly recommend using a virtual environment, such as `venv `__ or `conda `__. .. note:: We highly recommend installing and using the spacesense library on a Linux operating system. Installation on Windows is possible, but is highly troublesome, being highly reliant on python version, processor type, and highly specific dependencies. Pre-requisites ---------------------- - Python 3.7 or 3.8 should already be installed on your system (but we highly recommend python 3.7). Installing with Venv ---------------------- On Linux/macOS ~~~~~~~~~~~~~~~~~~~~ Create a virtual environment .. code-block:: bash python3.7 -m venv venv Activate the virtual environment .. code:: bash source venv/bin/activate Upgrade pip & setuptools .. code:: bash python -m pip install --upgrade pip pip install -U setuptools Install the latest version of the client library .. code:: bash pip install -U spacesense On Windows ~~~~~~~~~~~~~~~~~~~~ Create a virtual environment If you installed Python 3.7 from Microsoft store then you should be able to run the following command: .. code:: bash python3.7 -m venv venv If you downloaded python 3.7 from python.org then you should run this command instead: .. code:: bash python -3.7 -m venv venv Activate the virtual environment .. code:: bash venv\Scripts\activate Upgrade pip & setuptools .. code:: bash python -m pip install --upgrade pip pip install -U setuptools Install the latest version of the client library .. code:: bash pip install -U spacesense And you are now ready to go. .. note:: if you get the following error when installing the library with pip please refer to the `fix gdal dependencies`_ section. .. code:: bash (venv) PS C:\Users\user\my-project> pip install -U spacesense ... 14 ERROR: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a ... ... .. note:: if you get the following error when installing the library with pip please refer to the `fix netCDF dependencies`_ section. .. code:: bash (venv) PS C:\Users\user\my-project> pip install -U spacesense ... 14 ValueError: did not find HDF5 headers ... Fix gdal dependencies --------------------------- 1. Download those two wheel files.(Chose depending on your CPU) 1. For AMD CPU - Wheel for GDAL: `GDAL-3.4.2-cp37-cp37m-win_amd64.whl `__ - Wheel for rasterio: `rasterio-1.2.10-cp37-cp37m-win_amd64.whl `__ 2. For Intel CPU - Wheel for GDAL: `GDAL-3.4.2-cp37-cp37m-win32.whl `__ - Wheel for rasterio: `rasterio-1.2.10-cp37-cp37m-win32.whl `__ 2. Move the two wheels to a new folder called “libs” at the root of your project 3. build the wheels (make sure you are in your virtual environment created above) 1. For AMD CPU .. code:: bash pip install libs\GDAL-3.4.2-cp37-cp37m-win_amd64.whl libs\rasterio-1.2.10-cp37-cp37m-win_amd64.whl 1. For Intel CPU .. code:: bash pip install libs\GDAL-3.4.2-cp37-cp37m-win32.whl libs\rasterio-1.2.10-cp37-cp37m-win32.whl 4. Install SpaceSense library with pip .. code:: bash pip install -U spacesense you are now ready to go. Fix netCDF dependencies --------------------------- 1. Download those two wheel files.(Chose depending on your CPU) 1. For AMD CPU - Wheel for netCDF: `netCDF4-1.5.8-cp37-cp37m-win_amd64.whl `__ 2. For Intel CPU - Wheel for netCDF: `netCDF4-1.5.8-cp37-cp37m-win32.whl `__ 2. Move the two wheels to a new folder called “libs” at the root of your project 3. build the wheels (make sure you are in your virtual environment created above) 1. For AMD CPU .. code:: bash pip install libs\netCDF4-1.5.8-cp37-cp37m-win_amd64.whl 1. For Intel CPU .. code:: bash pip install libs\netCDF4-1.5.8-cp37-cp37m-win32.whl 4. Install SpaceSense library with pip .. code:: bash pip install -U spacesense you are now ready to go. ------------------------- Installing with Anaconda ------------------------ .. _on-linuxmacos-1: On Linux/macOS ~~~~~~~~~~~~~~~~~~~~ Create a virtual environment .. code:: bash conda create --name myenv python=3.7 Activate the virtual environment .. code:: bash conda activate myenv Install the latest version of the client library .. code:: bash pip install -U spacesense you are now ready to go. .. _on-windows-1: On Windows ~~~~~~~~~~~~~~~~~~~~ Create a virtual environment .. code:: bash conda create --name myenv python=3.7 Activate the virtual environment .. code:: bash conda activate myenv Upgrade install rasterio .. code:: bash conda install -c conda-forge rasterio Install the latest version of the client library .. code:: bash pip install -U spacesense you are now ready to go. -------------- We want to make sure this project is as easy as possible to install. If something is not working as intended, make sure to let us know at support@spacesense.ai.