kenangan 发表于 2022-11-19 21:29:55

求救:安装parsel出错原因是什么?

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting parsel
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/81/0a/554a3a07dc158eab169403814f8aa3cfc78c39a85ac83c5b9cb7a7c72fe4/parsel-1.7.0-py2.py3-none-any.whl (14 kB)
Requirement already satisfied: packaging in d:\pythonproject\venv\lib\site-packages (from parsel) (21.3)
Collecting cssselect>=0.9
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/06/a9/2da08717a6862c48f1d61ef957a7bba171e7eefa6c0aa0ceb96a140c2a6b/cssselect-1.2.0-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: w3lib>=1.19.0 in d:\pythonproject\venv\lib\site-packages (from parsel) (2.0.1)
Collecting lxml
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/70/bb/7a2c7b4f8f434aa1ee801704bf08f1e53d7b5feba3d5313ab17003477808/lxml-4.9.1.tar.gz (3.4 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in d:\pythonproject\venv\lib\site-packages (from packaging->parsel) (3.0.9)
Building wheels for collected packages: lxml
Building wheel for lxml (setup.py): started
Building wheel for lxml (setup.py): finished with status 'error'
Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml, cssselect, parsel
    Running setup.py install for lxml: started
    Running setup.py install for lxml: finished with status 'error'

ERROR: Command errored out with exit status 1:
   command: 'D:\pythonProject\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv = '"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-1kzez184\\lxml_73e8fc72db89409f9153cb4e59c2d19a\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-1kzez184\\lxml_73e8fc72db89409f9153cb4e59c2d19a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\admin\AppData\Local\Temp\pip-wheel-6dt4gr2_'
       cwd: C:\Users\admin\AppData\Local\Temp\pip-install-1kzez184\lxml_73e8fc72db89409f9153cb4e59c2d19a\
Complete output (75 lines):
Building lxml version 4.9.1.
Building without Cython.
Building against pre-built libxml2 andl libxslt libraries
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.11
creating build\lib.win-amd64-3.11\lxml
copying src\lxml\builder.py -> build\lib.win-amd64-3.11\lxml
copying src\lxml\cssselect.py -> build\lib.win-amd64-3.11\lxml
copying src\lxml\doctestcompare.py -> build\lib.win-amd64-3.11\lxml
copying src\lxml\ElementInclude.py -> build\lib.win-amd64-3.11\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-3.11\lxml
copying src\lxml\sax.py -> build\lib.win-amd64-3.11\lxml
copying src\lxml\usedoctest.py -> build\lib.win-amd64-3.11\lxml
copying src\lxml\_elementpath.py -> build\lib.win-amd64-3.11\lxml
copying src\lxml\__init__.py -> build\lib.win-amd64-3.11\lxml
creating build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win-amd64-3.11\lxml\includes
creating build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\builder.py -> build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\clean.py -> build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\defs.py -> build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\diff.py -> build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-3.11\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win-amd64-3.11\lxml\html
creating build\lib.win-amd64-3.11\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-3.11\lxml\isoschematron
copying src\lxml\etree.h -> build\lib.win-amd64-3.11\lxml
copying src\lxml\etree_api.h -> build\lib.win-amd64-3.11\lxml
copying src\lxml\lxml.etree.h -> build\lib.win-amd64-3.11\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-3.11\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\__init__.pxd -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-3.11\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-3.11\lxml\includes
creating build\lib.win-amd64-3.11\lxml\isoschematron\resources
creating build\lib.win-amd64-3.11\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\rng
creating build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl
creating build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
warning: build_py: byte-compiling is disabled, skipping.

running build_ext
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for lxml
    ERROR: Command errored out with exit status 1:
   command: 'D:\pythonProject\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv = '"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-1kzez184\\lxml_73e8fc72db89409f9153cb4e59c2d19a\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-1kzez184\\lxml_73e8fc72db89409f9153cb4e59c2d19a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\admin\AppData\Local\Temp\pip-record-8msxb8zk\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\pythonProject\venv\include\site\python3.11\lxml'
         cwd: C:\Users\admin\AppData\Local\Temp\pip-install-1kzez184\lxml_73e8fc72db89409f9153cb4e59c2d19a\
    Complete output (77 lines):
    Building lxml version 4.9.1.
    Building without Cython.
    Building against pre-built libxml2 andl libxslt libraries
    running install
    D:\pythonProject\venv\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.11
    creating build\lib.win-amd64-3.11\lxml
    copying src\lxml\builder.py -> build\lib.win-amd64-3.11\lxml
    copying src\lxml\cssselect.py -> build\lib.win-amd64-3.11\lxml
    copying src\lxml\doctestcompare.py -> build\lib.win-amd64-3.11\lxml
    copying src\lxml\ElementInclude.py -> build\lib.win-amd64-3.11\lxml
    copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-3.11\lxml
    copying src\lxml\sax.py -> build\lib.win-amd64-3.11\lxml
    copying src\lxml\usedoctest.py -> build\lib.win-amd64-3.11\lxml
    copying src\lxml\_elementpath.py -> build\lib.win-amd64-3.11\lxml
    copying src\lxml\__init__.py -> build\lib.win-amd64-3.11\lxml
    creating build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\__init__.py -> build\lib.win-amd64-3.11\lxml\includes
    creating build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\builder.py -> build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\clean.py -> build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\defs.py -> build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\diff.py -> build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\formfill.py -> build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\html5parser.py -> build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\soupparser.py -> build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-3.11\lxml\html
    copying src\lxml\html\__init__.py -> build\lib.win-amd64-3.11\lxml\html
    creating build\lib.win-amd64-3.11\lxml\isoschematron
    copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-3.11\lxml\isoschematron
    copying src\lxml\etree.h -> build\lib.win-amd64-3.11\lxml
    copying src\lxml\etree_api.h -> build\lib.win-amd64-3.11\lxml
    copying src\lxml\lxml.etree.h -> build\lib.win-amd64-3.11\lxml
    copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-3.11\lxml
    copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\config.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\__init__.pxd -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-3.11\lxml\includes
    copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-3.11\lxml\includes
    creating build\lib.win-amd64-3.11\lxml\isoschematron\resources
    creating build\lib.win-amd64-3.11\lxml\isoschematron\resources\rng
    copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\rng
    creating build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl
    copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl
    copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl
    creating build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-3.11\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    warning: build_py: byte-compiling is disabled, skipping.
   
    running build_ext
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\pythonProject\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv = '"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-1kzez184\\lxml_73e8fc72db89409f9153cb4e59c2d19a\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-1kzez184\\lxml_73e8fc72db89409f9153cb4e59c2d19a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\admin\AppData\Local\Temp\pip-record-8msxb8zk\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\pythonProject\venv\include\site\python3.11\lxml' Check the logs for full command output.
WARNING: You are using pip version 21.3.1; however, version 22.3.1 is available.
You should consider upgrading via the 'D:\pythonProject\venv\Scripts\python.exe -m pip install --upgrade pip' command.

cflying 发表于 2022-11-19 21:34:51

你是python 3.11?

kenangan 发表于 2022-11-19 21:40:46

cflying 发表于 2022-11-19 21:34
你是python 3.11?

是的

jackz007 发表于 2022-11-19 21:51:16

kenangan 发表于 2022-11-19 21:40
是的

https://visualstudio.microsoft.com/visual-cpp-build-tools/
       解决方法已经告诉你了,下载上面链接 MSVC ++ build tools,然后,安装它。

cflying 发表于 2022-11-19 21:57:45

kenangan 发表于 2022-11-19 21:40
是的

你回退装3.10版的或者3.9版本的应该就OK了,
如果确实想用3.11,就用vs_buildtools工具安装一个msvc和windows10/11sdk环境就好了,其他的可以不装

jackz007 发表于 2022-11-19 23:05:31

本帖最后由 jackz007 于 2022-11-19 23:10 编辑

         Python 一定要选择安装次最新版,这是因为,新版 Python 发布后,第三方库往往需要相当长一段时间之后才能跟上,如果跟最新版太紧,则很有可能无法安装某些第三方库,这一点常常让人抓狂。所以,距离产生美,是有道理的。
页: [1]
查看完整版本: 求救:安装parsel出错原因是什么?