snowflake.snowpark.Session.add_requirements¶
- Session.add_requirements(file_path: str) None[source] (https://github.com/snowflakedb/snowpark-python/blob/release-v1.3.0/src/snowflake/snowpark/session.py#L766-L812)¶
Adds a requirement file (https://pip.pypa.io/en/stable/user_guide/#requirements-files) that contains a list of packages as dependencies of a user-defined function (UDF).
- Parameters:
file_path – The path of a local requirement file.
Example:
Note
1. This method will add packages for all UDFs created later in the current session. If you only want to add packages for a specific UDF, you can use
packagesargument infunctions.udf()orsession.udf.register().2. We recommend you to setup the local environment with Anaconda, to ensure the consistent experience of a UDF between your local environment and the Snowflake server.