Friday, April 8, 2011

Installing JModelica after PythonXY

To get JModelica 1.5 to work with PythonXY 2.6.5.6 on win7 Professional, the following steps will work:
  1. Install PythonXY using default options.
  2. Start the JModelica install. When given a choice on where install, choose C:\.
  3. Add a path file to the site-packages directory in python. In a default install of PythonXY, the location is “C:\Python26\Lib\site-packages”. The name of the file should be “jmodelica.pth”. The contents of the file is a single line “C:\JModelica.org-1.5\Python”. To understand how Python paths work, see this reference.
  4. Open “C:\JModelica.org-1.5\setenv.bat” with a text editor. Manually set all of the environment variables in your system to match the environment variables defined in this file.
  5. Start a python interpreter in PythonXY.
  6. Follow the direction for testing in “C:\JModelica.org-1.5\README.TXT”. The tests should complete successfully.
Addendum:
   This approach also works with JModelica 1.6 and PythonXY 2.7.2.
   Simply substitute "JModelica.org-1.6" for "JModelica.org-1.5" in the above steps.
This work is licensed under a Creative Commons Attribution By license.