# How to install third party libraries in DBT Python model (using snowpark)

**URL:** <https://discourse.getdbt.com/t/how-to-install-third-party-libraries-in-dbt-python-model-using-snowpark/12150>\
**Category:** Help\
**Tags:** snowflake, dbt-cloud\
**Created:** [February 21, 2024, 2:30pm UTC](https://discourse.getdbt.com/t/how-to-install-third-party-libraries-in-dbt-python-model-using-snowpark/12150 "2024-02-21T14:30:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manjukrishnan](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@manjukrishnan](https://discourse.getdbt.com/u/manjukrishnan)\
**Post date:** [February 21, 2024, 2:30pm UTC](https://discourse.getdbt.com/t/how-to-install-third-party-libraries-in-dbt-python-model-using-snowpark/12150/1 "2024-02-21T14:30:05Z")

</div>

## I am trying to convert a python code into dbt python model .

My code is using some libraries like swifter, pynndescent etc .. Per the documentation ([Snowflake Snowpark for Python](https://repo.anaconda.com/pkgs/snowflake/)) I am able to get majority of the packages that I need for my code, but there are few which is needed by code and those are not supported .

I want to know

1. how to include unsupported packages like swifter
2. For the libraries that I am using I need to be able to specify the versions , how can I do that in the python model?  
Example - pynndescent==0.5.11, geopy==2.4.1, pgeocode==0.4.1, scipy==1.11.4, swifter==1.4.0

## Sample of my code with libraries, when I add swifter in dbt.config then I am getting the error (ModuleNotFoundError: No module named ‘swifter’)

```auto
def model(dbt,session):
    """
    This function is the main function to be
    called when the script is to be run

    """
    dbt.config(materialized="table",
        packages = ["pandas", "numpy", "python-dateutil", "pytz", "urllib3", "requests", "typing_extensions", 
        "pynndescent", "geopy", "scipy", "typing", "pytz" ]
    )

```
