# ODBC Driver 17 for SQL Server on Ransberry Pi4

**URL:** <https://forum.core-electronics.com.au/t/odbc-driver-17-for-sql-server-on-ransberry-pi4/9625>\
**Category:** Raspberry Pi\
**Created:** [12 March 2021 01:41 UTC](https://forum.core-electronics.com.au/t/odbc-driver-17-for-sql-server-on-ransberry-pi4/9625 "2021-03-12T01:41:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luca151498](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@Luca151498](https://forum.core-electronics.com.au/u/Luca151498)\
**Post date:** [12 March 2021 01:41 UTC](https://forum.core-electronics.com.au/t/odbc-driver-17-for-sql-server-on-ransberry-pi4/9625/1 "2021-03-12T01:41:07Z")

</div>

Hi there,  
i m trying to connect my Ransberry Pi4 with a SQL server but I m having issues installing the required ODBC driver.

here the script

Import pyodbc  
conn = pyodbc.connect(“DRIVER={ODBC Driver 17 for SQL Server};”  
“SERVER= server\_name;”  
“DATABASE= database\_name;”  
“UID= id;”  
“PwD = password”;")

I have tried to install the driver following the instruction of the following link:

> **[Install the Microsoft ODBC driver for SQL Server (Linux) - SQL Server](https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#microsoft-odbc-driver-17-for-sql-server)**
>
> Learn how to install the Microsoft ODBC Driver for SQL Server on Linux clients to enable database connectivity.

But the driver can not be installed.

Has anyone found a solution to this problem?

thanks and regards  
Luca

---

<div class="post-metadata">

**Author:** ![Bryce](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryce/32/3631_2.png) [@Bryce](https://forum.core-electronics.com.au/u/Bryce)\
**Post date:** [16 March 2021 02:24 UTC](https://forum.core-electronics.com.au/t/odbc-driver-17-for-sql-server-on-ransberry-pi4/9625/2 "2021-03-16T02:24:23Z")

</div>

Hey Luca,

Welcome to the forum! 🥳

How interesting, have you been able to receive any form of error message? You’ve said that the driver cannot be installed, but is there any kind of warning or notification that you’re receiving through the terminal to let you know what’s going on? Thanks.

---

<div class="post-metadata">

**Author:** ![Luca151498](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@Luca151498](https://forum.core-electronics.com.au/u/Luca151498)\
**Post date:** [17 March 2021 05:50 UTC](https://forum.core-electronics.com.au/t/odbc-driver-17-for-sql-server-on-ransberry-pi4/9625/3 "2021-03-17T05:50:03Z")

</div>

Hi Bryce,  
thank you for your feedback.

following the Microsoft procedure i get the following error

pi@raspberrypi:~ $ sudo ACCEPT\_EULA=Y apt-get install -y msodbcsql17  
Reading package lists… Done  
Building dependency tree  
Reading state information… Done  
**E: Unable to locate package msodbcsql17**

downloading the package and trying to install it manually

sudo dpkg -i msodbcsql17\_17.7.2.1-1\_amd64.deb  
dpkg: error processing archive msodbcsql17\_17.7.2.1-1\_amd64.deb (–install):  
**package architecture (amd64) does not match system (armhf)**  
**Errors were encountered while processing:**  
\*\* msodbcsql17\_17.7.2.1-1\_amd64.deb\*\*

i m looking forward to additional feedback on this  
thanks  
Luca

---

<div class="post-metadata">

**Author:** ![Bryce](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryce/32/3631_2.png) [@Bryce](https://forum.core-electronics.com.au/u/Bryce)\
**Post date:** [23 March 2021 00:50 UTC](https://forum.core-electronics.com.au/t/odbc-driver-17-for-sql-server-on-ransberry-pi4/9625/4 "2021-03-23T00:50:35Z")

</div>

Hi Luca,

I’ve found the issue, the architecture of the Pi is armhf (ARM is typical for phones, some microcontrollers such as the Pi, and similar) the msodbcsql17 library is not supported by any architecture other than AMD64. Unfortunately, the tutorial that you’ve listed doesn’t suit the Raspberry Pi, you can run it only on linux systems running on a system with the architecture AMD64.

[https://docs.microsoft.com/en-us/answers/questions/214606/arm-build-availability-for-ms-odbc-driver-for-sql.html](https://docs.microsoft.com/en-us/answers/questions/214606/arm-build-availability-for-ms-odbc-driver-for-sql.html)

Here’s another forum discussing the issue, please let me know if there’s anything else that we can do for you.
