Windows installation

Although OpenAtlas is developed and tested to install on Linux (Debian to be precise) there are cases one might install it on a Windows system e.g. to try it out or for developing.
We don't recommend to use a Windows installation for a productive use but want to give some instruction how to go about nevertheless.

Keep in mind that these instructions are not maintained as regularly as the ones for the main environment Linux and might therefore not be entirely up to date.

Software Installation

Required software

You find a package list at requirements.txt the root of the OpenAtlas application which can be used, e.g. to install software with pip

Further you will need:

Install Microsoft Visual C++ 14.0 or greater

To be able to install all required packages MV C++ 14.00 or greater is needed. You can get it via https://visualstudio.microsoft.com/visual-cpp-build-tools/ the name of the required package in the build tools is "MSVC... Buildtools" we tested it with "MSVC v143 - VS 2022 C++-x64/x86-Buildtools" but it might work with older versions as well.

Install PostgreSQL and PostGIS

The download link for the newest PostgreSQL Version Windows installer can be found on [[https://www.postgresql.org/download/windows/]] in the first line under "Download the installer".
Choose the appropriate version and use the installer to get PostgreSQL, during the process you can choose to use the stack builder tool to install additional extensions. Through this you can also easily obtain and install PostGIS, though there are other ways as well should you want to.
Change locale to en_US UTF-8 otherwise the export tests will fail.

Step by Step:

Add to PATH

PostgreSQL
Add C:\Program Files\PostgreSQL\13\bin to the Path variable at the environmental variables

7zip
Add C:\Program Files\7-Zip to the Path variable at the environmental variables

Install ImageMagick

Download the newest version from https://imagemagick.org/script/download.php#windows and install it (https://docs.wand-py.org/en/0.6.10/guide/install.html#install-imagemagick-on-windows use this guide).
Important: Install the dll version, not the static one!

Restart your PC to make sure all PATH variables are successfully registered.

Project SetUp

SetUp with PgAdmin4

Database Setup

Setting up "production.py" & "testing.py"

This is used to set variables for the project configuration. You will find an example in the instance folder.

For testing.py repeat the same steps but:

Install the Requirements

In the project root directory run the following command:
- pip install -r requirements.txt

Install the Frontend Libraries

Run the following commands (from the project root directory):

Setup process for the tests (WIP, not yet functional)

Installing the required packages:

Uncomment the lines following "# Used for testing" in "requirements.txt" then execute the following command:
- pip install -r requirements.txt

Setting up the Test Database with PgAdmin 4

Running the tests

For test running:

In order to run the tests on Windows you'll need to delete the tests/__init__.py and then run the command:

This will prevent your changes to tests/__init__.py from being commited. For information on how or why this works please look at https://stackoverflow.com/a/14462290 and https://stackoverflow.com/a/13631525 respectively.

Then you cans run the tests with:

If you encounter the error "./test_reference_system.py::ReferenceSystemTest::test_reference_system Failed with Error: 'file_upload_max_size'" during testing, you can try deleting all files in the "../files/uploads" directory, except for ".gitignore". Sometimes, on Windows, images from previous tests may not be cleared, causing subsequent tests to fail.

If you have other files in the directory that you don't want to delete, the files uploaded by the tests are the OpenAtlas logo in both .jpeg and .png formats, as well as one .json file describing OpenAtlas. Removing these files should be sufficient.

Install with scoop.sh (no administration rights)

Use PowerShell
Get scoop: https://scoop.sh/

OpenAtlas

scoop install git 
scoop bucket add versions
scoop bucket add extras
scoop install python39 imagemagick nodejs

Collaboration

scoop install pycharm mattermost

Testing

Add a new tmp path to the testing.py where the user can write if /tmp not available, e.g.:

from pathlib import Path
TMP_DIR = Path('C:\\Users\\USERNAME')

Add

LOAD_WINDOWS_TEST_SQL = True

to the testing.py to load the SQL for Windows.
Create a new folder
C:\iiif

and install Cantaloupe_5