Python Module Search Path

Python searches for an imported module in the list of directories given by the Python variable sys.path.

This variable is initialized from the directory containing the application, and in the list of directories specified by the environment variable PYTHONPATH, which uses the same syntax as the shell variable PATH, that is, a list of directory names. If you have not set PYTHONPATH, or if the file is not found, the search continues in an installation-dependent default path.

To use the Adaptive Server Enterprise extension module for Python in an application, you must set either PYTHONPATH, or the Python variable sys.path to one of the following directory paths (these are the default directories where the different versions of the Adaptive Server Python extension module are installed):

Platform

Default Installation Path

Python Version

Windows

%SYBASE%\%SYBASE_OCS%\python\python26_64\dll

2.6

%SYBASE%\%SYBASE_OCS%\python\python27_64\dll

2.7

%SYBASE%\%SYBASE_OCS%\python\python31_64\dll

3.1

All other platforms

$SYBASE/$SYBASE_OCS/python/python26_64r/lib

2.6, 2.7

$SYBASE/$SYBASE_OCS/python/python31_64r/lib

3.1