.. # split from OEPlatformFunctions.rst:632

.. include:: ../substitutions

.. oe:namespace:: OEPlatform

.. meta::
   :keywords: OESetLicenseFile

.. oe:function:: OESetLicenseFile

   .. oe:language:: c++ java csharp

      .. oe:api::

         void OESetLicenseFile(const char* fname)

   .. oe:language:: python

      .. oe:api:: python

         OESetLicenseFile(fname: str) -> None

   Set the OpenEye license file to use to perform license checks. This
   can be used instead setting the ``OE_LICENSE`` environment variable.

   .. oe:language:: python

      .. note::

         Although *OEChem* can be imported without a license check
         other OpenEye libraries may perform their license check at
         load time. Therefore, this function should be used before
         importing those libraries, for example:

         .. code-block:: python

            from openeye.oechem import *
            OESetLicenseFile("/usr/local/openeye/oe_license.txt")
            from openeye.oespicoli import *

