Skip to content

Using Phylanx with Python on Windows

Parsa Amini edited this page Feb 22, 2018 · 2 revisions

To use Phylanx's Python module on a Windows machine you first need to build Phylanx. After that you need to have the HPX bin directory, Phylanx bin directory and Phylanx Python directory to in your path. This may be accomplished by doing one of the following:

  • Add them to Python's sys.path

e.g:

import sys
sys.path += [
    r'C:\repos\hpx\cmake-build-debug\Debug\bin',
    r'C:\repos\phylanx\cmake-build-debug\Debug\bin',
    r'C:\repos\phylanx\cmake-build-debug\python\build\lib.win-amd64-3.7'
]
  • Add them to PYTHONPATH variable in the application environment

e.g. Inside Command Prompt you can do:

set PYTHONPATH="C:\repos\hpx\cmake-build-debug\Debug\bin;C:\repos\phylanx\cmake-build-debug\Debug\bin;C:\repos\phylanx\cmake-build-debug\python\build\lib.win-amd64-3.7;"

before you run python.

  • Add them to PYTHONPATH system-wide

Modify the PYTHONPATH environment variable or create the variable if it does not already exist and add the mentioned directories to it.

e.g. Contents of the PYTHONPATH

C:\repos\hpx\cmake-build-debug\Debug\bin;C:\repos\phylanx\cmake-build-debug\Debug\bin;C:\repos\phylanx\cmake-build-debug\python\build\lib.win-amd64-3.7;"

Ater adding all the aforementioned directories to Python's search path you should be able to do import phylanx

Clone this wiki locally