pymssql

Trouble installing pymssql on Windows

 ̄綄美尐妖づ 提交于 2019-12-05 16:34:24
I can't find great support for pymssql installation support on Windows. I'm trying to connect to an enterprise database through another employee's python wrapper. This wrapper requires my installing of pymssql. The RTFM on this doesn't have very explicit instructions on the installation process of FreeTDS and OpenSSL. Steps to Install All downloaded files (FreeTDS and OpenSSL) are from the RTFM link mentioned above. There is mention of adding both downloads to a C:\Program Files folder and adding the binaries into the system PATH , so I did this: FreeTDS Downloaded FreeTDS >> created the

pymssql: executemany value error - expected a simple type, a tuple or a list

谁说我不能喝 提交于 2019-12-05 14:01:53
grpidx_data=[] for i in range(0,len(data1)): grpidx_data.append((data1.loc[i,'price'],data1.loc[i,'id'])) cur.executemany("insert into grpidx values (%s,%s)",grpidx_data) I use python3.3 and pymssql. I want to import data from python to MSSQL. grpidx_data's type is list(tuple) ,like[(12,1),(34,2),...], I run the code above then got the error: ValueError: expected a simple type, a tuple or a list If I just use the data which type is list(tuple) , the code works fine. But when I use for loop got the data, even its type also list(tuple) ,its not working. So How to solve this problem? Thanks! I

Cannot install pymssql on windows

空扰寡人 提交于 2019-12-05 08:34:04
i am trying to install pymssql as pip install pymssql i have windows 7 and python 3.5 (from anaconda) but i get Failed building wheel for pymssql i believe its related to freetds and python-dev . how do i install these on windows? Which packages would i need to install? this pip install worked just fine for python 2.7. If the pip does not work,is there any other way i can download and install pymssql? Jason Sperske I just went through this small bit of hell and finally got things working, here is what I ended up doing: First locate your Python directory (for me it was c:\Python35 ), then

Error Installing pymssql on Mac OS X Yosemite

两盒软妹~` 提交于 2019-12-05 07:03:46
I receive the following error when installing pymssql on OS X Yosemite 10.10.3 - has anyone gotten around the following error? I am using FreeTDS (v0.91.112) version 7.1 and Python 2.7.6 - the tsql utility connects to a SQL Database with no issue. sudo pip install pymssql Error : Command "/usr/bin/python -c "import setuptools, tokenize; __file__='/private/tmp/pip-build-T5Usla/pymssql/setup.py'; exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-uZGqK4-record/install- record.txt --single-version-externally-managed -

pandas 数据库数据的读取

随声附和 提交于 2019-12-05 03:52:59
绝大多数公司都会选择将数据存入数据库中,因为数据库既可以存放海量数据,又可以非常便捷地实现数据的查询。下面以MySQL和SQL Server为例,来练习Pandas模块和 对应的数据库模块。 首先需要介绍pymysql模块和pymssql模块中的连接函数connect,虽然两个模块中的连接函数名称一致,但函数的参数并不完全相同,所以需要分别介绍函数用法和几个重要参数 的含义: (1) pymysql中的connect 函数原型: pymysql.connect(host = None,user=None,password=' ',database=None,port=0,charset='') 1.host:指定需要访问的MySQL服务器 2.user:指定访问MySQL数据库的用户名 3.password:指定访问MySQL数据库的密码 4.database:指定访问MySQL数据库的具体库名 5.port:指定访问MySQL数据库的端口号 6.charset:指定读取MySQL数据库的字符集,如果数据库表中含有中文,一般可以尝试将该参数设置为“utf8”或者“gbk”。 (2)pymssql中的connect pymssql.connect(server = None,user =None,password = None,database =None,charset =None

Connect to SQL Server instance using pymssql on Windows

。_饼干妹妹 提交于 2019-12-05 03:44:38
I'm attempting to connect to a SQL Server instance from a Windows box using pymssql (version 2.0.0b1-dev-20111019 with Python 2.7.1). I've tried the most basic approach from the console: import pymssql c = pymssql.connect(host = r'servername\instance', user = 'username', password = 'userpassword') In response to this, I get the very helpful error: InterfaceError: Connection to the database failed for an unknown reason. I am reasonably confident that the connection information is correct, as it works when I use adodbapi, with the following commands: import adodbapi c = adodbapi.connect(r

Flask app with ArcGIS, Arcpy does not run

二次信任 提交于 2019-12-05 02:06:15
I have a script that gets a table from MSSQL database and then registers it with ArcGIS. It uses several other arcpy methods as well. I tried to combine it with Flask and developed an HTML interface where you can specify tables. The script runs on console perfectly well, however, when running with Flask on http://127.0.0.1:5000/ , the arcpy functions do not run, then the app throws errors. I am using my local python directory, so I do not have any problem with importing arcpy on flask. So, I am able to use pymssql functions and create a new table, however when it comes to arcpy function, It

pymssql ( python module ) unable to use temporary tables

六眼飞鱼酱① 提交于 2019-12-04 21:03:35
This isn't a question, so much as a pre-emptive answer. (I have gotten lots of help from this website & wanted to give back.) I was struggling with a large bit of SQL query that was failing when I tried to run it via python using pymssql, but would run fine when directly through MS SQL. (E.g., in my case, I was using MS SQL Server Management Studio to run it outside of python.) Then I finally discovered the problem: pymssql cannot handle temporary tables. At least not my version, which is still 1.0.1. As proof, here is a snippet of my code, slightly altered to protect any IP issues: conn =

How to install pymssql on MacOS Sierra

ε祈祈猫儿з 提交于 2019-12-04 17:48:31
问题 Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-J1I0ox/pymssql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qmtdBW-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-J1I0ox/pymssql/ I am having the same error as displayed here . I followed the instructions on

Error installing pymssql on Mac OS X Lion

无人久伴 提交于 2019-12-04 14:04:42
问题 I have XCode installed and also FreeTDS. I tried to connect to my SQL Server and it works perfect. Now I have to develop an aplication on python that works with this SQL Server and I´m trying to install pymsql, but I got this error when I launche sudo python setup.py command: ==> sudo python setup.py install running install running bdist_egg running egg_info writing pymssql.egg-info/PKG-INFO writing top-level names to pymssql.egg-info/top_level.txt writing dependency_links to pymssql.egg-info