python的pymssql模块的报错_【昊鼎王五】pip安装pymssql模块时报错“PEP 517”怎么解决?...

在尝试使用pip安装pymssql模块时遇到PEP 517错误,错误信息指出版本不匹配。解决方法是通过指定版本号进行安装,如`pip install "pymssql<3.0"`,这将安装兼容的版本,避免报错。
部署运行你感兴趣的模型镜像

【昊鼎王五】pip安装pymssql模块时报错“PEP 517”怎么解决?

背景

在https://blog.csdn.net/haoding205/article/details/103242102中已经讲到了如何安装pip工具,此篇就讲一个典型的安装第三方库时报错的解决方法。

报错信息

如下图:

29a14832e95fbdf1104ee1898f411bda.png

[root@centos tmp]# pip3 install pymssql

Collecting pymssql

Using cached https://files.pythonhosted.org/packages/4a/20/bcd4db9e7990b50e85280f0c9488c0a53f7e6bf9048203448d8e0f29a536/pymssql-3.0.3.tar.gz

Installing build dependencies ... done

Getting requirements to build wheel ... done

Installing backend dependencies ... done

Preparing wheel metadata ... done

Building wheels for collected packages: pymssql

Building wheel for pymssql (PEP 517) ... error

ERROR: Command errored out with exit status 1:

command: /usr/local/python3/bin/python3.7 /usr/local/python3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmplktlmv2p

cwd: /tmp/pip-install-6x1763de/pymssql

Complete output (42 lines):

running bdist_wheel

running build

installing to build/bdist.linux-x86_64/wheel

running install

/tmp/pip-build-env-b2tk6mrs/overlay/lib/python3.7/site-packages/setuptools/dist.py:46: DistDeprecationWarning: Do not call this function

warnings.warn("Do not call this function", DistDeprecationWarning)

...(此处略去1000+字)

File "/usr/local/python3/lib/python3.7/distutils/cmd.py", line 313, in run_command

self.distribution.run_command(command)

File "/usr/local/python3/lib/python3.7/distutils/dist.py", line 985, in run_command

cmd_obj.run()

File "setup.py", line 449, in run

raise DeprecationWarning(msg)

DeprecationWarning: The pymssql project has been discontinued. To install the last working released version, use a

version specifier like "pymssql<3.0". For details and alternatives see:

https://github.com/pymssql/pymssql/issues/668

----------------------------------------

ERROR: Failed building wheel for pymssql

Running setup.py clean for pymssql

Failed to build pymssql

ERROR: Could not build wheels for pymssql which use PEP 517 and cannot be installed directly

[root@centos tmp]

分析

遇到问题不要怕,也不要慌,沉着冷静,总有解决方法。

仔细看报错信息,突然有一条实际上已经告诉了答案。就是版本不匹配,

,那如何才能版本匹配呢?

需要低于3.0版本的pymssql才能安装。

解决命令

命令如下:

pip install "pymssql<3.0"

pip list

如下图:

d4efb37573be217c7030dc7213bb87d6.png

总结

当报错信息是版本不匹配时,按照提示信息,输入正确的版本限制语法,安装就成功了。

好了,聪明如你,就讲到这里吧,有问题的话可以留言。

5ee385bac754a7e67ed34c5622f13fb4.png

您可能感兴趣的与本文相关的镜像

Python3.9

Python3.9

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值