Instructions how to install the CSXCAD & openEMS python interface.
Make sure CSXCAD and openEMS was build and installed correctly. See Install from Source.
Simple version (if installed to /usr/local):
cd CSXCAD python setup.py install cd .. cd openEMS python setup.py install cd ..
Extended options, e.g. for custom install path at ~/opt/openEMS:
python setup.py build_ext -I/opt/include -L/opt/lib -R/opt/lib" pyhton setup.py install
Note: The install command may require root on Linux, or add
--user to install to ~/.local
Install Pre-build Modules
For some python versions, pre-build egg files can be found in the python sub-directory. E.g. for python 3.9:
cd C:\opt\openEMS\python python -m easy_install CSXCAD-0.6.2-py3.9-win-amd64.egg python -m easy_install openEMS-0.0.33-py3.9-win-amd64.egg
Build Modules From Source
Download the sources using git. Assuming the MSVC binary build of openEMS is install at “C:\opt\openEMS”, run from a working python command prompt (e.g. using WinPython):
git clone --recursive https://github.com/thliebig/openEMS-Project.git cd openEMS-Project/CSXCAD/python python setup.py build_ext -IC:\opt\openEMS\include -LC:\opt\openEMS python setup.py install cd ../../openEMS/python python setup.py build_ext -IC:\opt\openEMS\include -LC:\opt\openEMS python setup.py install
Important Note: Python needs to find the dependent libraries (dll’s) during module import. To allow this, it is necessary to set an environment variable (permantently):
setx OPENEMS_INSTALL_PATH C:\opt\openEMS