Skip to content
Nate Jensen edited this page Dec 14, 2021 · 33 revisions
  • New in 3.3: Jep can be built on Windows with python setup.py build.
  • New in 3.4: Jep is easier to build on Windows, requiring less configuration steps.
  • New in 4.0: Jep should be easier to build on Windows.

Compilers

The Jep build should be easier on Windows with version 4.0. Specifically, with newer versions of Python 3, you do not have to match the exact same compiler version as was used to build Python.

To build, you need to install Microsoft Visual Studio 2015, 2017, or 2019. The Community Edition is fine. Newer versions might work too but haven't been tested.

Any deviation from these compilers (i.e. MinGW or a different version of MSVC) is at your own risk. If you manage to successfully build with variations and have a working and stable Jep, we'd love to hear about it. The following steps presume you allow MSVC to install to its default directories. If you install MSVC elsewhere, you may have to slightly alter steps that mention specific paths.

Running the build

After you've installed Visual Studio, you should be ready to build Jep. You might want to make a virtualenv to keep things isolated, and if you wanted numpy support you should install it now if it's not already installed. An easy way to get a numpy install working on Windows is to download a wheel from this page: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

If you want to install the numpy wheel, use pip install path/to/wheelfile.whl. If you're using virtualenv, make sure you run the pip command after you've activated the virtualenv so numpy installs to the virtualenv.

To run the build, open a command prompt (or powershell, git bash, etc) and cd to the jep dir. Next run python setup.py build. If all goes well you will end up with a build dir with some jars, jep.dll, jep.bat, and a few other files. Running python setup.py test will let you run the unit tests. Running python setup.py install will place the files in their appropriate locations:

  • Python's Lib/site-packages/jep directory
    • jep *.py files
    • jep jar file
    • jep.dll
  • Python's Scripts directory
    • jep.bat

If you'd like further testing, simply run the jep.bat file to use the interactive interpreter.

Further Help

If you encounter trouble, check the history of this wiki page. It has a lot of information on it that is now considered obsolete but may help you solve a build on Windows problem.

Other Insights

The setup.py build command should produce a jep.pyd file and a jep.dll file. pyd files are very similar to DLLs. (In Jep they are identical but the file extension is very important). If Python were to load the library, we'd probably want a pyd file, but since the library will be loaded from Java, we need a DLL. The DLL will retain a manifest in the file so the operating system can load it correctly. The setup.py install command should only install the jep.dll file. If by chance you somehow end up with both jep.pyd and jep.dll installed, you must remove the jep.pyd file as it will get loaded first and will not work correctly.

Clone this wiki locally