Before you can install pyodbc you must first install unixodbc with the following commands:
mkdir -p ~/opt/src
cd ~/opt/src
wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.11.tar.gz
tar zxf unixODBC-2.3.11.tar.gz
cd unixODBC-2.3.11/
./configure --prefix=$HOME/opt
make
make install
export CPPFLAGS="-I$HOME/opt/include $CPPFLAGS"
export LDFLAGS="-L$HOME/opt/lib $LDFLAGS"
Once that's done you can activate your env and run pip install pyodbc
.
Hope this helps 🙂