Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation instructions on Linux and Windows #276

Open
0intro opened this issue Sep 14, 2024 · 0 comments
Open

Installation instructions on Linux and Windows #276

0intro opened this issue Sep 14, 2024 · 0 comments

Comments

@0intro
Copy link

0intro commented Sep 14, 2024

Introduction

As of September 2024, Ortho4XP requires numpy < 2, but numpy < 2 only supports Python up to version 3.10.
So you have to install Python 3.10.

Installation on Linux

One you have installed Python 3.10, you can follow these instructions, which should work on any Linux distribution:

Install Python dependencies

python3.10 -m venv $HOME/venv-Ortho4XP
. $HOME/venv-Ortho4XP/bin/activate
pip install --upgrade pip

python -m pip install numpy==1.26.4
python -m pip install Pillow
python -m pip install scikit-fmm
python -m pip install requests
python -m pip install pyproj
python -m pip install shapely
python -m pip install rtree

Install Ortho4XP

git clone -q https://github.com/oscarpilote/Ortho4XP
cd Ortho4XP
./Ortho4XP.py

Installation on Windows

Requirements

  1. [Optional] Download and install Git for Windows.
  2. Download and install MSYS2. Follow the instructions to install a C++ compiler. This is required to build the scikit-fmm Python extension module.
  3. Download and install Python for Windows. The latest version of the 3.10 branch is Python 3.10.11.

PATH

Add the following directories to your PATH:

C:\msys64\mingw64\bin
C:\Program Files\Python310
C:\Users\xxx\AppData\Roaming\Python\Python310\Scripts

Install Python dependencies

python.exe -m pip install --upgrade pip

python.exe -m pip install numpy==1.26.4
python.exe -m pip install Pillow
python.exe -m pip install scikit-fmm
python.exe -m pip install requests
python.exe -m pip install pyproj
python.exe -m pip install shapely
python.exe -m pip install rtree

Install Ortho4XP

You can either download Ortho4XP from the zip archive or download with Git:

git clone -q https://github.com/oscarpilote/Ortho4XP

If you start Ortho4XP.py, you will probably come across this error:

  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\skfmm\__init__.py", line 51, in <module>
    from .pfmm import distance, travel_time, extension_velocities
  File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\skfmm\pfmm.py", line 4, in <module>
    from .cfmm import cFastMarcher
ImportError: DLL load failed while importing cfmm: The specified module could not be found.

It will happen because the libgcc and libstdc++ library dependencies (available as part of MSYS2) of skfmm are not part of the trusted DLL path of Python.

The easy way to solve this issue is to add this line at the top of the Ortho4XP.py file, after the imports (notably the os import).

os.add_dll_directory(\"C:\\msys64\\mingw64\\bin\");

Now you can start Ortho4XP.py (double-click).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant