如何在 Python 2.7 中安装雪花连接器

时间:2021-02-23 22:44:45

标签: python python-2.7 pip snowflake-cloud-data-platform

我正在尝试为 Python 2.7.10 版安装雪花连接器。大多数说明适用于 Python 3.6 及更高版本。我需要获取所需的库才能使其工作。到目前为止,这是我使用过的,但现在可以使用了。

sudo yum install libffi-devel
sudo pip install setuptools==40.8.0
sudo pip install snowflake-connector-python
sudo pip install snowflake-connector-python==1.7.9
sudo pip install ipaddress
sudo pip install cryptography==2.6.1 --no-cache-dir
sudo pip install azure_storage_common==1.4.0
sudo pip install azure_storage_blob==1.5.0

您可能会问我为什么使用 Python 2.7。这是因为我使用的是旧的 AWS EMR 4.7,它的 oozie 工作流程仅适用于 Python 2.7。

谢谢, 大卫

1 个答案:

答案 0 :(得分:0)

运行这个,你应该能够用 Python 2.7 运行雪花:

sudo yum install libffi-devel -y
sudo pip install setuptools==18.5
sudo pip install -r https://raw.githubusercontent.com/snowflakedb/snowflake-connector-python/v2.3.9/tested_requirements/requirements_36.reqs
sudo pip install snowflake-connector-python==1.7.9
sudo pip install ipaddress==1.0.23

sudo rm -rf /usr/local/lib64/python2.7/site-packages/cryptography*

sudo pip install cryptography==2.6.1 --no-cache-dir
sudo pip install azure_storage_common==1.4.0
sudo pip install azure_storage_blob==1.5.0