Having issue with new space (pyodbc error)
I am new to spaces, so forgive me if basic question. Trying to get my app.py to build, but keeps getting stuck at pyodbc import. I have pyodbc in my requirements.txt file, and build fails when it hits the import pyodbc line in app.py. Traceback below. Any ideas?===== Application Startup at 2023-07-30 15:53:20 =====Traceback (most recent call last):File “/home/user/app/app.py”, line 18, inimport pyodbcImportError: libodbc.so.2: cannot open shared object file: No such file or directory
2023-08-02T18:50:20Z
Was able to advance from this erorr by having unixodbc in package.txt. However now getting driver error when trying to connect using pyodbc:Error: (‘01000’, “[01000] [unixODBC][Driver Manager]Can’t open lib ‘SQL Server’ : file not found (0) (SQLDriverConnect)”)
2023-11-27T18:18:48Z
Hi.same issue here. Have you solved it yet?Thanks in advance
2023-11-30T01:22:39Z
could you please share a bit about what are you trying to run on Spaces? thanks
2023-11-30T05:00:00Z
Yes, thanks for your interestI’m using streamlit to make a data visualize app. Using pyodbc to connect with my Microsoft SQL Server databasehere is my connection string, with server is <IP address,port> and this connect run perfectly local anw.@st.cache_resource
def init_connection():
    return pyodbc.connect(
        "DRIVER={ODBC Driver 17 for SQL Server};SERVER="
        + st.secrets["server"]
        + ";DATABASE="
        + st.secrets["database"]
        + ";UID="
        + st.secrets["username"]
        + ";PWD="
        + st.secrets["password"]
    )

conn = init_connection()

@st.cache_data(ttl=600)
def run_query(query):
    data = pd.read_sql(query, conn)
    return datathere error cause atconn = init_connection()I encoutered error exactly the post above. At first is anImportErrorand after fixing by having unixodbc in package.txt, this error encounterError: (‘01000’, “[01000] [unixODBC][Driver Manager]Can’t open lib ‘SQL Server’ : file not found (0) (SQLDriverConnect)”)please, feel free for any ideas or info. thanks in advance