Skip to content

Instantly share code, notes, and snippets.

@daemotron
Created October 27, 2018 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daemotron/a1fedf757a3a095335f820619d391b99 to your computer and use it in GitHub Desktop.
Save daemotron/a1fedf757a3a095335f820619d391b99 to your computer and use it in GitHub Desktop.
Install Ortho4XP on Windows

Python can be installed in various flavours - I have 2.7, 3.6 and 3.7 installed on my machine in parallel, without further issues. For Ortho4XP, I'd recommend Python 3.7 in a 64 bit flavour - and install it under C:\python37 (it doesn't interfere with Python 2.7).

My Ortho lives on an external HDD (mine is called k:). There, I just created a directory for O4XP to live in. I use 1.30 for quite a while, so I had to fetch it via git. Not sure it's still the case, but it's the only way I know... I use cmder to have a better console than default, and it comes with Git for Windows bundled if you like to...

Furthermore, you'll need a couple of Python libraries which normally require a compiler, but there's a site hosting pre-compiled packages for Windows, which is highly useful: www.lfd.uci.edu/~gohlke/pythonlibs/

From there, you'll need GDAL, Pillow, Rtree, Shapely, numpy, numpy_quaternion and pyproj (latest cp37-amd64 versions). When you download these, they come as wheel archive (.whl files). Put them somewhere on your hard disk.

Now we can start creating your environment. Launch a command line (assuming it's cmder or cmd.exe), and perform the following steps:

  1. Create a virtual environment
k:
mkdir Ortho4XP
cd Ortho4XP
python --version
python -m venv venv
venv\Scripts\activate.bat
  1. Install requried packages
python -m pip install --upgrade pip setuptools
pip install GDAL-2.2.4-cp37-cp37m-win_amd64.whl
pip install Pillow-5.2.0-cp37-cp37m-win_amd64.whl
pip install Rtree-0.8.3-cp37-cp37m-win_amd64.whl
pip install Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl
pip install numpy-1.15.1+mkl-cp37-cp37m-win_amd64.whl
pip install numpy_quaternion-2018.7.5-cp37-cp37m-win_amd64.whl
pip install pyproj-1.9.5.1-cp37-cp37m-win_amd64.whl

pip install certifi chardet idna requests urllib3

For the .whl files, you have to indicate the path to where the files actually are - my command example pretends they're in the same directory, which isn't necessarily the case. Also the version numbers might have slightly changed...

  1. Get Ortho4XP
git clone https://github.com/oscarpilote/Ortho4XP.git

After that, you should have the following structure:

k:
|
+--+ Ortho4XP/
   |
   +--+ Ortho4XP/
   |
   +--+ venv/
  1. Launch Ortho4XP
cd k:\Ortho4XP\Ortho4XP
python Ortho4XP_v130.py

For this to work, the virtual environment must be activated. We already did that at the end of step 1, but if you close the terminal in between, you have to retype the venv\scripts\activate.bat command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment