Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple import won't work on Python 3.8.2 #258

Open
husamrahmanh2o opened this issue Apr 27, 2020 · 8 comments
Open

simple import won't work on Python 3.8.2 #258

husamrahmanh2o opened this issue Apr 27, 2020 · 8 comments

Comments

@husamrahmanh2o
Copy link

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.

@keitherskine
Copy link
Contributor

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.

@MugiJR
Copy link

MugiJR commented Apr 30, 2020

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.

@keitherskine
Copy link
Contributor

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.

@xhochy
Copy link
Collaborator

xhochy commented May 18, 2020

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.

@prdctofchem

This comment has been minimized.

@wanstr

This comment has been minimized.

@xhochy

This comment has been minimized.

@husamrahmanh2o
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants