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

How to install pymssql, I have installed freetds, but still can not install properly. #543

Closed
wuhuanyan opened this issue Jul 10, 2018 · 6 comments

Comments

@wuhuanyan
Copy link

My operating system is: macOS High Sierra 10.13.3

install freetds

'''
(study) admindeMacBook-Pro:~ admin$ brew install freetds
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/freetds-1.00.92.high_sierra.bottle.tar.gz
Already downloaded: /Users/admin/Library/Caches/Homebrew/freetds-1.00.92.high_sierra.bottle.tar.gz
==> Pouring freetds-1.00.92.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/freetds/1.00.92: 2,094 files, 11.9MB
'''

install pymssql

'''
(study) admindeMacBook-Pro:~ admin$ pip install pymssql
Collecting pymssql
Using cached https://files.pythonhosted.org/packages/4c/c8/5ad36d8d3c304ab4f310c89d0593ab7b6229568dd8e9cde927311b2f0c00/pymssql-2.1.3.tar.gz
Building wheels for collected packages: pymssql
Running setup.py bdist_wheel for pymssql ... error
Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/hw/0f6xq_q54d92s4v7ppltg5640000gn/T/pip-install-pndvd65y/pymssql/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /private/var/folders/hw/0f6xq_q54d92s4v7ppltg5640000gn/T/pip-wheel-d0t6xpvy --python-tag cp36:
setup.py: platform.system() => 'Darwin'
setup.py: platform.architecture() => ('64bit', '')
setup.py: platform.libc_ver() => ('', '')
setup.py: Detected Darwin/Mac OS X.
You can install FreeTDS with Homebrew or MacPorts, or by downloading
and compiling it yourself.

  Homebrew (http://brew.sh/)
  --------------------------
  brew install freetds

  MacPorts (http://www.macports.org/)
  -----------------------------------
  sudo port install freetds

setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/usr/local/include', '/opt/local/include', '/opt/local/include/freetds']
setup.py: library_dirs = ['/usr/local/lib', '/opt/local/lib']
running bdist_wheel
running build
running build_ext
building '_mssql' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/usr/local/include -I/opt/local/include -I/opt/local/include/freetds -I/anaconda3/include/python3.6m -c _mssql.c -o build/temp.macosx-10.7-x86_64-3.6/_mssql.o -DMSDBLIB
_mssql.c:18814:15: error: use of undeclared identifier 'DBVERSION_80'
__pyx_r = DBVERSION_80;
^
1 error generated.
error: command 'gcc' failed with exit status 1


Failed building wheel for pymssql
Running setup.py clean for pymssql
Failed to build pymssql
distributed 1.21.8 requires msgpack, which is not installed.
'''

@wuhuanyan
Copy link
Author

It looks as if I've fixed it.
https://stackoverflow.com/questions/37771434/mac-pip-install-pymssql-error

pip install git+https://github.com/pymssql/pymssql.git

@JayRizzo
Copy link

@wuhuanyan,

I also tested and verified on my mac that this works with pip3 - homebrew freetds 0.91 & 1.00.94

pip3 install git+https://github.com/pymssql/pymssql.git 

Thank you! I was searching all over for this fix!

@codeman101
Copy link

codeman101 commented Nov 17, 2019

That doesn't work anymore because those versions of freetds are unavailable.

@DeadLemon
Copy link

Same issue, any improvements?

@lohraspco
Copy link

I had this problem on macOS and tried many things. The steps in https://pymssql.readthedocs.io/en/stable/intro.html
helped me.

brew install freetds
pip install pymssql

@xpnhcnsh
Copy link

I had this problem on macOS and tried many things. The steps in https://pymssql.readthedocs.io/en/stable/intro.html
helped me.

brew install freetds
pip install pymssql

Thanks bro, this helps me out!

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