Installation
Contents
Installation#
Everything you need to know to start using SpaceSense’s library.
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
python3.7 -m venv venv
Activate the virtual environment
source venv/bin/activate
Upgrade pip & setuptools
python -m pip install --upgrade pip
pip install -U setuptools
Install the latest version of the client library
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:
python3.7 -m venv venv
If you downloaded python 3.7 from python.org then you should run this command instead:
python -3.7 -m venv venv
Activate the virtual environment
venv\Scripts\activate
Upgrade pip & setuptools
python -m pip install --upgrade pip
pip install -U setuptools
Install the latest version of the client library
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.
(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.
(venv) PS C:\Users\user\my-project> pip install -U spacesense
...
14 ValueError: did not find HDF5 headers
...
Fix gdal dependencies#
Download those two wheel files.(Chose depending on your CPU)
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
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
Move the two wheels to a new folder called “libs” at the root of your project
build the wheels (make sure you are in your virtual environment created above)
For AMD CPU
pip install libs\GDAL-3.4.2-cp37-cp37m-win_amd64.whl libs\rasterio-1.2.10-cp37-cp37m-win_amd64.whl
For Intel CPU
pip install libs\GDAL-3.4.2-cp37-cp37m-win32.whl libs\rasterio-1.2.10-cp37-cp37m-win32.whl
Install SpaceSense library with pip
pip install -U spacesense
you are now ready to go.
Fix netCDF dependencies#
Download those two wheel files.(Chose depending on your CPU)
For AMD CPU
Wheel for netCDF: netCDF4-1.5.8-cp37-cp37m-win_amd64.whl
For Intel CPU
Wheel for netCDF: netCDF4-1.5.8-cp37-cp37m-win32.whl
Move the two wheels to a new folder called “libs” at the root of your project
build the wheels (make sure you are in your virtual environment created above)
For AMD CPU
pip install libs\netCDF4-1.5.8-cp37-cp37m-win_amd64.whl
For Intel CPU
pip install libs\netCDF4-1.5.8-cp37-cp37m-win32.whl
Install SpaceSense library with pip
pip install -U spacesense
you are now ready to go.
Installing with Anaconda#
On Linux/macOS#
Create a virtual environment
conda create --name myenv python=3.7
Activate the virtual environment
conda activate myenv
Install the latest version of the client library
pip install -U spacesense
you are now ready to go.
On Windows#
Create a virtual environment
conda create --name myenv python=3.7
Activate the virtual environment
conda activate myenv
Upgrade install rasterio
conda install -c conda-forge rasterio
Install the latest version of the client library
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.