Windows installation
dg46 opened this issue · 3 comments
Continuous integration pipeline works on ubuntu image, but changing to windows image results in errors (first is Java related, then some issue with multithreading in pytest when the unit tests are run). I am using cause2e on a windows machine for my own analyses, so I know that it can work. Will fix the pipeline so that CI ensures that cause2e is in a usable state for linux and windows users.
For the Java issue: This is a known issue with javabridge (required by py-causal in the causal discovery step).
As explained here, make sure you have JAVA SDK 8 installed and set your JAVA_HOME and JDK_HOME environment variables correctly. See cause2e's azure-pipelines.yml for an example.
Edit: The following more detailed instruction hopefully helps:
- make sure you are using Python >= 3.7
- remove artifacts from previous installation attempts:
-- remove all Java installations (runtimes, JDKs, SDKs...)
-- remove javabridge, py-causal and cause2e installations (via pip uninstall)
-- remove JAVA_HOME and JDK_HOME from environment variables (if you have set them before) - install Java (use the "offline-version" installer, as the online installer might install 32bit when you actually need 64bit)
- download JDK 8
- set JAVA_HOME and JDK_HOME variables to point to the directories where the Java runtime and the JDK are located
- install Visual C++ 2013
- install javabridge (from PyPI), py-causal (from https://github.com/bd2kccd/py-causal) and cause2e (from PyPI) in this order; do not try "pip install pycausal", as this will install the wrong package
If you still get errors (look at pip output during javabridge installation, it should install version 1.0.19 without complaining), check this file for the corresponding error message. You will see where javabridge expects certain Java files to be. Use this to set JAVA_HOME and/or JDK_HOME accordingly before reinstalling javabridge.
As a reference, our azure pipeline correctly installs cause2e, after setting JDK_HOME. For further debugging, try comparing your set up with the software that is pre-installed on the build image.
For the pytest issue: This seems related to the problem. Despite the continuing error messages, I was able to make all unit tests run as intended by removing a blocker in heatmap plotting. Since the issue only occurs in the CI pipeline, it should not cause problems to users.
The issue will be closed once I have merged the changes into the main branch.