[PYTHON]
;
; Python settings
;
pythonpath = semi-colon or new line delimited list of directories
executable = full path to the Python executable (python.exe)
dll = full path to the Python dynamic link library (pythonXX.dll)
pythonhome = location of the standard Python libraries
ignore_environment = ignore environment variables when initializing Python
The Python settings determine which Python interpreter will be used, and some Python settings.
Generally speaking, when your system responds to the python
command by running the
correct interpreter there is usally no need to alter this part of your configuration.
Sometimes you may want to specify options that differ from your system default; for example, when using a Python virtual environment or if the Python you want to use is not installed as your system default Python.
pythonpath
The pythonpath is a list of directories that Python will search in when importing modules.
When writing your own code to be used with PyXLL you will need to change this to include the directories where that code can be imported from.
[PYTHON]
pythonpath =
c:\path\to\your\code
c:\path\to\some\more\of\your\code
.\relative\path\relative\to\config\file
executable
If you want to use a different version of Python than your system default Python then setting this option will allow you to do that.
Note that the Python version (e.g. 2.7 or 3.5) must still match whichever Python version you selected when downloading PyXLL, but this allows you to switch between different virtual environments or different Python distributions.
PyXLL does not actually use the executable for anything, but this setting tells PyXLL where it can expect to find the other files it needs as they will be installed relative to this file (e.g. the Python dll and standard libraries).
[PYTHON]
executable = c:\path\to\your\python\installation\pythonw.exe
If you wish to set the executable globally outside of the config file, the environment variable
PYXLL_PYTHON_EXECUTABLE
can be used. The value set in the config file is used in preference over
this environment variable.
dll
PyXLL can usually locate the necessary Python dll without further help, but if your installation is non-standard or you wish to use a specific dll for any reason then you can use this setting to indform PyXLL of its location..
[PYTHON]
dll = c:\path\to\your\python\installation\pythonXX.dll
If you wish to set the dll globally outside of the config file, the environment variable
PYXLL_PYTHON_DLL
can be used. The value set in the config file is used in preference over
this environment variable.
pythonhome
The location of the standard libraries is usually determined by the location of the Python executable.
If for any reason the standard libraries are not installed relative to the chosen or default executable then setting this option will tell PyXLL where to find them.
Usually if this setting is set at all it should be set to whatever
sys.prefix
evaluates to in a Python prompt from the relevant
interpreter.
[PYTHON]
pythonhome = c:\path\to\your\python\installation
If you wish to set the pythonhome globally outside of the config file,
the environment variable PYXLL_PYTHONHOME
can be used. The value set
in the config file is used in preference over this environment variable.
ignore_environment
New in PyXLL 3.5
When this option is set to any value, any standard Python environment
variables such as PYTHONPATH
are ignored when initializing Python.
This is advisable so that any global environment variables that might conflict with the settings in the pyll.cfg file do not affect how Python is initialized.
This must be set if using FINCAD, as FINCAD sets PYTHONPATH to it’s own internal Python distribution.