简体   繁体   中英

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

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...

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

I had the same problem and I fixed this way.

  1. Download pymssql module from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pymssql . place the .whl file in the C:\\Python38-32 folder.

  2. Open cmd.exe

  3. Run

    cd C:\\Python38-32
    pip install pymssql-2.1.4-cp38-cp38-win32.whl

I had a same problem but its fixed this way.

Copied "rc.exe" and "rcdll.dll" from "C:\\Program Files (x86)\\Windows Kits\\8.1\\bin\\x86" Pasted "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin"

In my case helped me rollback to Python 3.8. Same problem I had on 3.10 x64

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM