如何在Databricks中安装PYODBC [英] How to install PYODBC in Databricks
问题描述
我必须在Databricks中安装pyodbc模块.
我尝试使用此命令(pip install pyodbc
),但由于出现以下错误而失败.
I have to install pyodbc module in Databricks.
I have tried using this command (pip install pyodbc
) but it is failed due to below error.
推荐答案
我使用pyobdc进行连接时遇到了一些问题,我的修复程序详细信息在这里:
I had some problems a while back with connecting using pyobdc, details of my fix are here: https://datathirst.net/blog/2018/10/12/executing-sql-server-stored-procedures-on-databricks-pyspark
我认为问题出在将数据砖集群上的PYTHONPATH设置为Python 2安装上.
I think the problem stems from PYTHONPATH on the databricks clusters being set to the Python 2 install.
我怀疑这些行:
%sh
apt-get -y install unixodbc-dev
/databricks/python/bin/pip install pyodbc
将为您工作.
更新:更简单(尽管您仍然需要上面的unixodbc-dev):
Update: Even simpler (though you will still need unixodbc-dev from above):
%sh
sudo apt-get install python3-pip -y
pip3 install --upgrade pyodbc
这篇关于如何在Databricks中安装PYODBC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!