How do I get started with PROC PYTHON on Windows platforms?

Nico Chart_21517
Nico Chart_21517
Altair Employee
edited July 8 in Altair RapidMiner

To use PROC PYTHON you will need access to a Python installation on your Windows machine. Altair SLC supports Python version 3.5 onwards. Please use a supported version of Python - see https://devguide.python.org/versions/.

You may install Python itself or you may install the Anaconda package that contains Python, R and more besides.

There is some documentation in the \doc\en folder of the Altair Analytics Workbench installation called WPS-Python-Procedure-User-Guide.pdf

There is also a sample program in the \doc\en\samples.zip called 11.0-PythonProcedure.sas that may be useful.

Altair SLC depends on an environmental variable called PYTHONHOME which you can either define in your windows environmental system variables or at the top of your SAS language program by using the syntax of the form:

options SET=PYTHONHOME "C:\Program Files\Python35";

Altair SLC takes the value of PYTHONHOME and uses it to locate the Python DLL shared object libraries. For example Python 3.5 provides libpython3.dll and libpython3.5.dll. Please make sure these files exist.

note: in the unlikely event that you need to specifically use a particular DLL then you can set the SLC-specific environment variable:

options SET=PYTHONLIB "%sysget(PYTHONHOME)\python35.dll";

PROC PYTHON requires the python packages 'numpy' and 'pandas' to be installed. The environment variable PYTHONPATH may be set to point to one or more 'site packages' locations (separated by semi-colon ";" characters). The default is equivalent to the single location:

options SET=PYTHONPATH "%sysget(PYTHONHOME)\Lib\site-packages";

 

Tagged: