python pymssql安装_步骤 1:配置 pymssql 环境 - SQL Server | Microsoft Docs

步骤 1:配置用于 pymssql Python 开发的开发环境Step 1: Configure development environment for pymssql Python development

01/19/2017

本文内容

需要配置满足先决条件的开发环境,才能使用 Python Driver for SQL Server 开发应用程序。You will need to configure your development environment with the prerequisites in order to develop an application using the Python Driver for SQL Server.

Python SQL 驱动程序使用 TDS 协议,此协议在 SQL Server 和 Azure SQL 数据库中默认启用。The Python SQL Drivers use the TDS protocol, which is enabled by default in SQL Server and Azure SQL Database. 这种方式无需任何其他配置。No additional configuration is required.

WindowsWindows

安装 Python 运行时和 pip 包管理器。Install Python runtime and pip package manager.

a.a. b.b. 单击相应的 Windows 安装程序 msi 链接。Click on the appropriate Windows installer msi link.

c.c. 下载后,运行 msi 以安装 Python 运行时Once downloaded run the msi to install Python runtime

从此处下载 pymssql 模块Download pymssql module from here

请确保选择了正确的 whl 文件。Make sure you choose the correct whl file. 例如:若要在 64 位计算机上使用 Python 2.7,请选择“pymssql‑2.1.1‑cp27‑none‑win_amd64.whl”。For example: If you are using Python 2.7 on a 64-bit machine choose pymssql‑2.1.1‑cp27‑none‑win_amd64.whl. 下载 whl 文件后,将它放入 C:\Python27 文件夹。Once you download the whl file, place it in the C:\Python27 folder.

打开 cmd.exeOpen cmd.exe

安装 pymssql 模块。Install pymssql module.

例如,若要在 64 位计算机上使用 Python 2.7:For example, if you are using Python 2.7 on a 64-bit machine:

> cd c:\Python27

> pip install pymssql‑2.1.1‑cp27‑none‑win_amd64.whl

Ubuntu LinuxUbuntu Linux

安装 Python 运行时和 pip 包管理器。Install Python runtime and pip package manager. Python 预安装在大多数 Ubuntu 发行版本中。Python comes pre-installed on most distributions of Ubuntu. 如果计算机中未安装 python,可以从 python.org 下载源 Tarball 并在本地生成,也可以使用包管理器:If your machine does not have python installed, you can either download the source tarball from python.org and build locally, or you can use the package manager:

> sudo apt-get install python

打开终端Open terminal

安装 pymssql 模块和依赖项Install pymssql module and dependencies

> sudo apt-get --assume-yes update

> sudo apt-get --assume-yes install freetds-dev freetds-bin

> sudo apt-get --assume-yes install python-dev python-pip

> sudo pip install pymssql

macOSmacOS

安装 Python 运行时和 pip 包管理器Install Python runtime and pip package manager

a.a. b.b. 单击相应的 macOS 安装程序 pkg 链接。Click on the appropriate macOS installer pkg link.

c.c. 下载完成后,运行 pkg 以安装 Python 运行时Once downloaded run the pkg to install Python runtime

打开终端Open terminal

安装 Homebrew 包管理器Install Homebrew package manager

> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

安装 FreeTDS 模块Install FreeTDS module

> brew install FreeTDS

安装 pymssql 模块Install pymssql module

> sudo -H pip install pymssql

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值