Closed MiguelElGallo closed 7 months ago
Please install unixODBC first ,as pointed out in the documentation.
Is installed and working: unixodbc 2.3.9_1 , error still persists
Is the file sql.h
in /usr/local/include/
or /usr/local/Cellar/unixodbc/2.3.9/include/
(if it was installed via brew)? I believe that's where it should be placed after installing unixODBC. If the files are there then there is something wrong with installation not looking in the right paths.
Installing unixodbc and Setting LDFLAGS and CPPFLAGS as mentioned on the main issue (https://github.com/mkleehammer/pyodbc/issues/846#issuecomment-986649632) for this worked for me.
My path was slightly different. Check yours.
ll /opt/homebrew/Cellar/unixodbc
@MiguelElGallo See https://github.com/mkleehammer/pyodbc/issues/846#issuecomment-813255685 for a workaround.
The default Homebrew installation path has changed for M1 Macs: /usr/local/
--> /opt/homebrew/
.
Is the file
sql.h
in/usr/local/include/
or/usr/local/Cellar/unixodbc/2.3.9/include/
(if it was installed via brew)? I believe that's where it should be placed after installing unixODBC. If the files are there then there is something wrong with installation not looking in the right paths.
This was the problem for me, after applying those two steps problem solved..
After looking around this is the solution that worked for me:
Step 1 - Install unixodbc with brew
brew install unixodbc
Step 2 - Make sure to note the version that has just been installed (as of today, I installed unixodbc 2.3.11)
Step 3 - Create the links just like in the documentation that you provided
https://github.com/mkleehammer/pyodbc/wiki
export LDFLAGS="-L/opt/homebrew/Cellar/unixodbc/[your version]/lib" export CPPFLAGS="-I/opt/homebrew/Cellar/unixodbc/[your version]/include"
Step 4 - Go on your project to install pyodbc
pip install pyobdc
And watch it FINALLY work!!
Earlier releases did not include Apple Silicon / ARM binary wheels, but we've added them to 5.0.0 beta 2. If you can, please test them. Details here:
Below command worked for to get wheel python -m pip install --only-binary=:all: pyodbc==4.0.32
But how to install ODBC driver in AWS Glue to connect AWS Microsoft RDS ?
Fixed by #1323 .
Please first make sure you have looked at:
Environment
To diagnose, we usually need to know the following, including version numbers. On Windows, be sure to specify 32-bit Python or 64-bit:
Issue
When installing PyODBC it fails with: Collecting pyodbc Using cached pyodbc-4.0.32.tar.gz (280 kB) Preparing metadata (setup.py) ... done Building wheels for collected packages: pyodbc Building wheel for pyodbc (setup.py) ... error
In file included from src/buffer.cpp:12: src/pyodbc.h:56:10: fatal error: 'sql.h' file not found
include
1 error generated. error: command 'clang' failed with exit status 1
ERROR: Failed building wheel for pyodbc