BeautifulSoup安装,输入setup.py build后没反应----可能是命令错误!

本文针对在安装BeautifulSoup过程中遇到的setup.pybuild命令无响应问题进行了详细的排查与解决。主要涉及环境变量配置及命令行参数调整等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

BeautifulSoup安装,输入setup.py build后没反应啊!瞬间懵逼了。

网上的帖子普遍是这么写的:

http://jingyan.baidu.com/article/afd8f4de6197c834e386e96b.html

然而对我并不适用。

于是我开始检查可能错误的原因:

1.Python没有配置环境变量

2.setup.py build以及setup.py intall命令有误


进入环境变量设置,检查Path变量,果然是空的(之前明明配置过的,不知道为什么突然为空了,可能是杀毒之类的原因),于是重新配置了变量。

参考:

http://jingyan.baidu.com/article/48206aeafdcf2a216ad6b316.html

第一个原因至此解决。


第二个原因:

Python是2.7版本的,beautifulsoup是4.4.1版本的,估摸着网上经验不可用,可能和版本变了命令变了有关。由于在cmd中运行.py类文件需要在前面加python,于是我试了试:

setup.py build

 setup.py intall

改成

python setup.py build

python setup.py install


这个命令很关键哦!

再试试!!!!是不是成功了?!

没成功也别气馁,多试几次!多看看攻略!

可能还有其他原因~

pip install --use-pep517 -r requirements.txt的时候报错WARNING: urllib3 2.4.0 does not provide the extra 'secure' Using cached colorama-0.3.9-py2.py3-none-any.whl (20 kB) Using cached jsonschema-2.6.0-py2.py3-none-any.whl (39 kB) Using cached six-1.12.0-py2.py3-none-any.whl (10 kB) Using cached idna-2.7-py2.py3-none-any.whl (58 kB) Using cached pyserial-3.4-py2.py3-none-any.whl (193 kB) Using cached mbed_ls-1.8.15-py2.py3-none-any.whl (37 kB) Using cached mbed_host_tests-1.8.15-py2.py3-none-any.whl (61 kB) Using cached mbed_greentea-1.8.15-py2.py3-none-any.whl (57 kB) Using cached beautifulsoup4-4.6.3-py3-none-any.whl (90 kB) Using cached pyelftools-0.28-py2.py3-none-any.whl (155 kB) Using cached pycryptodome-3.23.0-cp37-abi3-win_amd64.whl (1.8 MB) Using cached pyusb-1.3.1-py3-none-any.whl (58 kB) Using cached cmsis_pack_manager-0.2.10-py2.py3-none-win_amd64.whl (2.5 MB) Using cached cryptography-3.4.8-cp36-abi3-win_amd64.whl (1.6 MB) Using cached click-7.1.2-py2.py3-none-any.whl (82 kB) Using cached PyYAML-6.0.2-cp312-cp312-win_amd64.whl (156 kB) Using cached jinja2-3.1.6-py3-none-any.whl (134 kB) Using cached pywin32-310-cp312-cp312-win_amd64.whl (9.5 MB) Using cached cffi-1.17.1-cp312-cp312-win_amd64.whl (181 kB) Using cached MarkupSafe-3.0.2-cp312-cp312-win_amd64.whl (15 kB) Using cached milksnake-0.1.6-py2.py3-none-any.whl (11 kB) Using cached pycparser-2.22-py3-none-any.whl (117 kB) Building wheels for collected packages: hidapi Building wheel for hidapi (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for hidapi (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [21 lines of output] C:\Users\28492\AppData\Local\Temp\pip-build-env-d8pktwrf\overlay\Lib\site-packages\setuptools\dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: BSD License License :: OSI Approved :: GNU General Public License v3 (GPLv3) See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! self._finalize_license_expression() running bdist_wheel running build running build_ext Compiling hid.pyx because it changed. [1/1] Cythonizing hid.pyx building 'hid' extension error: unknown file type '.pxd' (from 'chid.pxd') [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for hidapi Failed to build hidapi ERROR: Failed to build installable wheels for some pyproject.toml based projects (hidapi)
最新发布
05-27
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值