ODBC Driver 17 for SQL Server on Ransberry Pi4

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:

But the driver can not be installed.

Has anyone found a solution to this problem?

thanks and regards

Hey Luca,

Welcome to the forum! :partying_face:

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.

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

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.


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