question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pyodbc import error 'GLIBC_2.25 not found' inside virtual environment

See original GitHub issue

Environment

  • Python: Anaconda python 3.6.5
  • pyodbc: 4.0.22
  • OS: Ubuntu 16.04.03 LTS
  • driver: msodbcsql17_17.1.0.1-1_amd64.deb

Issue

Actually I just want to use Flask command line tool together with flask-migrate to update my database model by using

flask db migrate

But got unexpected error message this time as below


(venv) root@CNBEH-REPORT-P21:/var/www/FlaskApp/FlaskApp# flask db migrate
/var/www/FlaskApp/FlaskApp/venv/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
Usage: flask db migrate [OPTIONS]

Error: While importing "FlaskApp.app", an ImportError was raised:

Traceback (most recent call last):
  File "/var/www/FlaskApp/FlaskApp/venv/lib/python3.6/site-packages/flask/cli.py", line 235, in locate_app
    __import__(module_name)
  File "/var/www/FlaskApp/FlaskApp/__init__.py", line 110, in <module>
    app = create_app()
  File "/var/www/FlaskApp/FlaskApp/__init__.py", line 87, in create_app
    from FlaskApp.Dashboard import db_mod
  File "/var/www/FlaskApp/FlaskApp/Dashboard/__init__.py", line 5, in <module>
    from FlaskApp.Dashboard import routes
  File "/var/www/FlaskApp/FlaskApp/Dashboard/routes.py", line 2, in <module>
    from FlaskApp.Dashboard.machine_status import status_plot
  File "/var/www/FlaskApp/FlaskApp/Dashboard/machine_status.py", line 8, in <module>
    mes_engine = create_engine(mes_string)
  File "/var/www/FlaskApp/FlaskApp/venv/lib/python3.6/site-packages/SQLAlchemy-1.2.10-py3.6-linux-x86_64.egg/sqlalchemy/engine/__init__.py", line 424, in create_engine
    return strategy.create(*args, **kwargs)
  File "/var/www/FlaskApp/FlaskApp/venv/lib/python3.6/site-packages/SQLAlchemy-1.2.10-py3.6-linux-x86_64.egg/sqlalchemy/engine/strategies.py", line 81, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/var/www/FlaskApp/FlaskApp/venv/lib/python3.6/site-packages/SQLAlchemy-1.2.10-py3.6-linux-x86_64.egg/sqlalchemy/connectors/pyodbc.py", line 38, in dbapi
    return __import__('pyodbc')
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0)

(venv) root@CNBEH-REPORT-P21:/var/www/FlaskApp/FlaskApp#

then I searched about the glibc version stuff, when I run ldd --version, I got

(venv) root@CNBEH-REPORT-P21:/var/www/FlaskApp/FlaskApp# ldd --version
ldd (Ubuntu GLIBC 2.23-0ubuntu9) 2.23
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

Even though glibc 2.23 here, the flask application itself works perfectly with pyodbc on the front end web page. The problem only happens when I try backend command stuff.

I don`t quite get the point why /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0 is mentioned here, I install anaconda python 3.6.5 as system wide python, and created virtual environment for flask application. I do search out another one located in anaconda folder:

find / -name '*libpython3*'
...
/usr/anaconda3/py36/lib/libpython3.6m.so.1.0
...

Are there any relations here? Really looking forward your help! Thanks a lot!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ivymichaelcommented, Dec 10, 2018

Hello v-chojas,

Thanks for your reply! I survived with the second-time installation withpython setup.py installcommand for latest pyODBC source code, and theflask shellcommand then works. But like I said, when using pip list checking the pyODBC version it says pyodbc 4.0.0-unsupported Any idea why it is like this? the package somehow still works in the environment.

0reactions
ivymichaelcommented, Dec 10, 2018

Thank you very much, I think the issue can be closed now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft App Service Error: 'version `GLIBC_2.29' not found ...
29' not found' while importing pyodbc for a Flask App. Hello,. I had an existing (and fully functioning) App Service (AS) running a...
Read more >
ModuleNotFoundError: No module named 'pyodbc' when ...
It turned out that the IDE I was using, PyCharm by JetBrains, had a different directory in which I had to install pyodbc....
Read more >
lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found ...
I have 2 repositories. In both I'm running a similar command (in Python's multiprocess , with 2 seconds sleep between).
Read more >
[Fixed] ModuleNotFoundError: No module named 'pyodbc'
Quick Fix: Python raises the ImportError: No module named 'pyodbc' when it cannot find the library pyodbc . The most frequent source of...
Read more >
“x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found ...
ImportError : /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version ... python virtual environment · how to read a file in python · python read file ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found