Comments (5)
Are you using an arm64 or amd64 Python?
The issue form asks those questions for a reason, so fill it in.
from pyodbc.
from pyodbc.
@v-chojas
ARM64 - I am using Apple M3 Pro.
from pyodbc.
I used this tutorial to make it work on my M1 mac, maybe it can help you.
PS: Don't forgot to change the 18s to 17, since that's the driver version you want.
Tutorial
Following: microsoft/homebrew-mssql-release#53
- Uninstall M1 versions of brew packages (if installed at all):
brew uninstall unixodbc msodbcsql18 mssql-tools18
- Install x86 Homebrew alongside the ARM M1 homebrew:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
- Then use x86 homebrew like arch -x86_64 /usr/local/bin/brew install or use the following alias (add to ~/.bash_profile or ~/.zshrc):
# Relies on having installed x86 brew like:
# arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
alias x86brew="arch -x86_64 /usr/local/bin/brew"
alias brew="/opt/homebrew/bin/brew" # M1 version, to avoid from using x86 version accidentally
- Install the ODBC packages.
x86brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
x86brew update
HOMEBREW_ACCEPT_EULA=Y x86brew install msodbcsql18 mssql-tools18
- Create an x86 conda env with:
ENV_NAME="rosetta"
CONDA_SUBDIR=osx-64 conda create -n $ENV_NAME python
conda activate $ENV_NAME
conda config --env --set subdir osx-64
- In order to install pyodbc, add to path (add to ~/.bash_profile or ~/.zshrc):
export LDFLAGS="-L/usr/local/Cellar/unixodbc/2.3.12/lib"
export CPPFLAGS="-I/usr/local/Cellar/unixodbc/2.3.12/include"
export PKG_CONFIG_PATH="/usr/local/Cellar/unixodbc/2.3.12/lib/pkgconfig"
PS: Pyodbc needs to be a recent version to be used with MAC M1.
from pyodbc.
That will work if you need to run x86 Python on an arm64 Mac for some reason, but beware that if you have other Python packages that are arm64, your x86 Python won't work with them.
from pyodbc.
Related Issues (20)
- Transaction is not getting rolled back HOT 7
- MACOS 系统使用 HOT 4
- Memory leak when passing strings within table value parameter to stored proc HOT 9
- Add support for SQLTablePrivileges
- Login Timeout Error when connecting to Synapse database using pyodbc python library in Azure synapse notebook via Managed Identity HOT 1
- reference count encoding in the connect function HOT 5
- PyToCType uses internal function removed from Python 3.13 HOT 3
- I am trying to install pyodbc in MacBook Pro M3 chip - arm64. The drivers are installed succesfully for odbc 13,17 and 18. But pyodbc is not able to detect the drivers.:
- Executing multiple queries HOT 1
- pyodbc.connect() gives an error when executing it with pytest HOT 1
- InterfaceError: Data source name not found with pyodbc despite working with isql HOT 8
- Multiple threads querying same table takes a long time HOT 19
- Timeout not being enforced in SQL query HOT 7
- How to use Federated credentials with service principal to auth the Azure resources HOT 7
- Ansi to Unicode conversion error (noob) HOT 9
- How to surface azure active directory service principal related errors HOT 3
- Do we need to close cursor in this case? HOT 9
- Connection pooling broken in 5.1.0 or 5.0.1 (with unixODBC 2.3.12)? HOT 3
- pyodbc.Connection' object has no attribute 'columns'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyodbc.