ODBC Driver 13 for SQL Server can't open lib on pyodbc while connecting on AWS E2 ubuntu instance

南楼画角 提交于 2019-11-28 10:13:29

As per nehaljwani's GitHub comment, this issue is related to libgcc mismatch. The official page suggests the minimum version of libgcc required for symbol v3.4.21 is v5.1.0.

GCC 5.1.0: GLIBCXX_3.4.21, CXXABI_1.3.9

Here are two suggestions how to solve it:

  • Update libgcc to >= 5.1.0 (recommended) by executing conda update libgcc. E.g.

    $ conda update libgcc
    ...
    The following packages will be UPDATED:
        libgcc: 4.8.5-2 --> 5.2.0-0
    
    Proceed ([y]/n)? y
    
    $ conda list gcc
    # packages in environment at /conda/envs/test:
    #
    libgcc                    5.2.0                         0
    (test) root@75eb43ff7f79:~$ readelf --version-info /conda/envs/test/lib/libstdc++.so | grep -Po '(?<=GLIBCXX_)([\d.]*)' | sort -Vr | head -1
    3.4.21
    
  • LD_PRELOAD trick (hacky)

    (test) root@75eb43ff7f79:~$ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 python test.py
    Reading data from table
    Microsoft SQL Server vNext (CTP2.0) - 14.0.500.272 (X64)
            Apr 13 2017 11:44:40
            Copyright (C) 2017 Microsoft Corporation. All rights reserved.
            Developer Edition (64-bit) on Linux (Ubuntu 16.04.2 LTS)
    

Troubleshooting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!