turbodbc
turbodbc copied to clipboard
simple import won't work on Python 3.8.2
I was able to successfully install turbodbc in a virtual environment but when I call "from turbodbc import connect" I get this error. Any thoughts on what I might be doing wrong? Thanks for everything in advance.
ImportError Traceback (most recent call last) c:\Users\User\Documents\SystemOptimization\SystemOptimization\connections.py in ----> 4 from turbodbc import connect
c:\Users\User\Documents\SystemOptimization\venv\lib\site-packages\turbodbc_init_.py in 2 3 from .api_constants import apilevel, threadsafety, paramstyle ----> 4 from .connect import connect 5 from .constructors import Date, Time, Timestamp 6 from .exceptions import Error, InterfaceError, DatabaseError, ParameterError
c:\Users\User\Documents\SystemOptimization\venv\lib\site-packages\turbodbc\connect.py in 4 import six 5 ----> 6 from turbodbc_intern import connect as intern_connect 7 8 from .exceptions import translate_exceptions, ParameterError
ImportError: DLL load failed while importing turbodbc_intern: A dynamic link library (DLL) initialization routine failed.
This might be related to #254 .
I don't know if turbodbc is available on Windows with conda and Python 3.8 yet, but trying to build turbodbc from scratch with Python 3.8 on Windows seem to be problematic.
yes @keitherskine . With Conda it's working as expected. But when I had tried to import turbodbc into python virtual environments, there were so many dependency issue. So general "pip install turbodbc" will not work i guess.
Collecting turbodbc
Using cached turbodbc-3.3.0.tar.gz (78 kB)
Requirement already satisfied: pybind11>=2.2.0 in c:\mugesh\projects\azure functions.venv\lib\site-packages (from turbodbc) (2.5.0)
Requirement already satisfied: six in c:\mugesh\projects\azure functions.venv\lib\site-packages (from turbodbc) (1.14.0)
Could not build wheels for turbodbc, since package 'wheel' is not installed.
Could not build wheels for pybind11, since package 'wheel' is not installed.
Could not build wheels for six, since package 'wheel' is not installed.
Installing collected packages: turbodbc
Running setup.py install for turbodbc ... error
ERROR: Command errored out with exit status 1:
command: 'c:\mugesh\projects\azure functions.venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Mugesh Ravi\AppData\Local\Temp\pip-install-yd0l0ior\turbodbc\setup.py'"'"'; file='"'"'C:\Users\Mugesh Ravi\AppData\Local\Temp\pip-install-yd0l0ior\turbodbc\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Mugesh Ravi\AppData\Local\Temp\pip-record-u499zyot\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\mugesh\projects\azure functions.venv\include\site\python3.8\turbodbc'
cwd: C:\Users\Mugesh Ravi\AppData\Local\Temp\pip-install-yd0l0ior\turbodbc
Complete output (27 lines):
warning: BOOST_ROOT enviroment variable not set
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\turbodbc
copying turbodbc\api_constants.py -> build\lib.win32-3.8\turbodbc
copying turbodbc\connect.py -> build\lib.win32-3.8\turbodbc
copying turbodbc\connection.py -> build\lib.win32-3.8\turbodbc
copying turbodbc\constructors.py -> build\lib.win32-3.8\turbodbc
copying turbodbc\cursor.py -> build\lib.win32-3.8\turbodbc
copying turbodbc\data_types.py -> build\lib.win32-3.8\turbodbc
copying turbodbc\exceptions.py -> build\lib.win32-3.8\turbodbc
copying turbodbc\options.py -> build\lib.win32-3.8\turbodbc
copying turbodbc_init_.py -> build\lib.win32-3.8\turbodbc
running egg_info
writing turbodbc.egg-info\PKG-INFO
writing dependency_links to turbodbc.egg-info\dependency_links.txt
writing requirements to turbodbc.egg-info\requires.txt
writing top-level names to turbodbc.egg-info\top_level.txt
reading manifest file 'turbodbc.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'turbodbc.egg-info\SOURCES.txt'
running build_ext
building 'turbodbc_intern' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\mugesh\projects\azure functions.venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Mugesh Ravi\AppData\Local\Temp\pip-install-yd0l0ior\turbodbc\setup.py'"'"'; file='"'"'C:\Users\Mugesh Ravi\AppData\Local\Temp\pip-install-yd0l0ior\turbodbc\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Mugesh Ravi\AppData\Local\Temp\pip-record-u499zyot\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\mugesh\projects\azure functions.venv\include\site\python3.8\turbodbc' Check the logs for full command output.
The error message "BOOST_ROOT environment variable not set" appears because turbodbc requires the Boost library. And yes, you generally require a version 14 MS C++ compiler too. For how to "pip install" directly, try the docs and some proposed updates to the docs for more help, and also perhaps this comment. Just FYI, I haven't been able to "pip install" turbodbc directly with Python 3.8 on Windows yet, but Python 3.7 is OK.
conda
-based turbodbc
does neither support Python 3.8 on Windows. The error message is too sparse to yet have any information what is actually going wrong.
Is support for 3.8 in the works? I would love to continue using this package (and see some of the experimental functions get developed) but am eventually going to have to update from 3.7. Thanks for all the hard work so far!
Somehow I get the feeling that Windows users, unlike many other areas, are the minority here....hence the little interest/attention :(
Somehow I get the feeling that Windows users, unlike many other areas, are the minority here....hence the little interest/attention :(
@wanstr please contribute here if you want to have the support. If no one is paying for it, nothing is going to happen ;)
Just downgrade to Python 3.7 and you'll be good to go. That's what I'm doing for any project where I use turbodbc.