pycountry package not imported in a python model

hi all, I am trying to generate a countries table using a python model in which I am importing pycountry, however I am getting below error. what could be the issue? Thanks
100357 (P0000): Cannot create a Python function with the specified packages. Please check your packages specification and try again.

import pycountry
import pandas as pd


def model(dbt, session):
    dbt.config(
        materialized = "table",
        packages = ["pycountry", "pandas"]
    )
    data = []
    for country in pycountry.countries:
        current = {'country': country.alpha_2,
                   'alpha3': country.alpha_3,
                   'country_name': country.name.replace("'", "-"),
                   'un_code': country.numeric
                   }
        data.append(current)
    countries = pd.DataFrame(data, columns=['country', 'alpha3', 'country_name', 'un_code'])
    return countries

Hi @duicu.cristina, which adapter are you using?

the snowflake one. from what I read so far it’s actually that snowflake is not supporting pycountry. is this the case? as a workaround I am generating the df as a csv and uploading it as seeds

These are the supported libs for snowpark

https://repo.anaconda.com/pkgs/snowflake/

As you said, unfortunately pycountry is not in the list (I did not find it)

1 Like

thank you for sharing the link and looking into this!