pyodbc import error 'GLIBC_2.25 not found' inside virtual environment
See original GitHub issueEnvironment
- 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:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Hello v-chojas,
Thanks for your reply! I survived with the second-time installation with
python setup.py install
command for latest pyODBC source code, and theflask shell
command then works. But like I said, when usingpip list
checking the pyODBC version it sayspyodbc 4.0.0-unsupported
Any idea why it is like this? the package somehow still works in the environment.Thank you very much, I think the issue can be closed now.