Installation#

Everything you need to know to start using SpaceSense’s library.

Please note: We highly recommend using a virtual environment, such as venv or conda.

Pre-requisites#

  • Python 3.7 should already be installed on your system.

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 ...
...

Fix gdal dependencies#

  1. Download those two wheel files.(Chose depending on your CPU)

    1. For AMD CPU

    2. For Intel CPU

  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

    pip install libs\GDAL-3.4.1-cp37-cp37m-win_amd64.whl libs\rasterio-1.2.10-cp37-cp37m-win_amd64.whl
    
    1. For Intel CPU

    pip install libs\GDAL-3.4.1-cp37-cp37m-win32.whl libs\rasterio-1.2.10-cp37-cp37m-win32.whl
    
  4. 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.