栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Conda/Python安装pymssql库出现Warning解决

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Conda/Python安装pymssql库出现Warning解决

以win10坏境为例:

直接

pip install pymssql

会出现以下报错: 

pip install pymssql
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pymssql/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pymssql/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pymssql/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pymssql/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pymssql/
ERROR: Could not find a version that satisfies the requirement pymssql (from versions: none)
ERROR: No matching distribution found for pymssql

哪怕是用了镜像,还是会有这上面这样的报错

pip install pymssql -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn

最后通过以下方式解决(保证你的电脑上安装了Anaconda,我装的最新python3.9的Anaconda):

到Anaconda官网,找到pymssql的安装包,我电脑是64位就选择这个 (注意看操作系统型号和py版本)

 

ctrl+R,输入cmd,进到命令行界面,然后

cd到刚刚下载的tar.bz2文件所处的目录,比如我的是下载到了Downloads文件夹,在命令行输入

cd ./Downloads
conda install --use-local pymssql-2.2.3-py39h2bbff1b_0.tar.bz2

然后在pycharm里就可以直接Import pymssql了~

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1033690.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号