Project

General

Profile

Actions

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:
  • NodeJs
  • npm (usually installed with NodeJs)
  • Python

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:
  • Run the PostGres installer
    • Install Path: Choose to your liking
    • Install all Components
    • Password: Choose one you'll remember
    • Port: Can be left on default or changed to fit preference
    • Locale: Choose English - United States
    • In the last step you will be able to disable the StackBuilder. Make sure you leave it enabled, then finish the installation.
  • Stack Builder:
    • Choose the PostGres Version
    • Spatial Extensions: Choose PostGis 3.3 (Though the other PostGis Versions should work as well)
    • Install Path: Choose to your liking
    • Run through the rest of the installation process, answering yes on all the questions

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

  • Login with the password you set during the PostGres SetUp
  • In the next screen you should already have/see a server
  • Set DB Password
  • Create a new User
    • Right Click Login/Group, Roles
    • Create -> Login/Group, Roles
    • Name: openatlas
    • Go to Tab "Definition"
    • Set the Password to: openatlas
    • Choose Privileges: All of them
    • Save

Database Setup

  • Creation:
    • Right click on Databases then choose Create > Database
    • Set name (openatlas)
    • Set owner to openatlas
    • Check in the Tab "Definition" that the encoding is UTF8
    • Save
  • Add extensions:
    • Right click on created DB > Create > Extension..
    • Select "postgis"
    • Repeat with "unaccent"
  • Set Up:
    • Right click the openatlas DB -> Choose query tool
    • Than either:
      • Copy the commands from OpenAtlas/Install/1_structure
      • or
      • Load File with commands from OpenAtlas/Install/1_structure
    • Repeat these steps for all the files in the Install folder
  • (optional) Import existing Dataset

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.

  • Copy example_production.py in the same folder and rename it to production.py
  • Change DATABASE_PASS to the password you have set, or want, for the OpenAtlas Database.
  • Through these two files you can also set other variables, but this will not be covered here.
For testing.py repeat the same steps but:
  • Use example_testing.py instead of example_production.py

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):
  • pip3 install calmjs
  • cd openatlas/static
  • pip3 install -e ./
  • npm --install openatlas

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

  • Follow the steps outlined in Database Setup, but choose the name openatlas_test instead.

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:
  • git update-index --skip-worktree .\tests\__init__.py

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:
  • python3.9.exe -m nose --verbose --config=.noserc

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

Updated by Bernhard Koschiček-Krombholz 6 months ago · 39 revisions

Also available in: PDF HTML TXT