Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install pymssql 2.1.3 in Pycharm

I'm working with Pycharm in a project to read SQL DBs ,I'm working in a windows 10 64bits workstation and I'm trying to install the module pymssql, I have already installed VS2015 to get all requirements but now each time that i try to install i got the message:

error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe' failed with exit status 2

I saw on message details the error in: _mssql.c(266): fatal error C1083: Cannot open include file: 'sqlfront.h': No such file or directory

How can i figured it out? thanks

like image 240
Andres Urrego Angel Avatar asked Jan 31 '23 01:01

Andres Urrego Angel


2 Answers

Seems that your error is a known problem, check here.
As you can see from the last post from the link, they don't have wheels built for Python3.6, so when you try to install pymssql, the error is raised.
Still, as the post found suggests, you can try the following options:

  1. Drop back to Python 3.5
  2. Use the Python 3.6 wheels available here:
  3. Try to build pymssql using the advice given in the forum link above.

If you were trying to install pymssql directly from PyCharm, I think that you should follow the options showed above but from command line

like image 172
Giordano Avatar answered Feb 02 '23 18:02

Giordano


For anyone that is seeing this in 2021, pymssql only supports python 3.7 according to their own build files. Don't bother trying to use it if you are on 3.8 or higher. I'm on 3.9.1

Use pyodbc instead. This install worked right out of the box using windows server 2016 after spending about 3 hours of digging.

pip install pyodbc

hope that saves you a ton of grief...

like image 32
Wrenbjor Avatar answered Feb 02 '23 16:02

Wrenbjor