好友
阅读权限10
听众
最后登录1970-1-1
|
1\情况如下:
本人新手小白自学 python 安装了
安装软件
本打算自学抓取 小说来着 结果没想到搞到一半犯难了 本着学习的态度请教各位大神 有指导的可以悬赏
2\问题描述
写代码需要的 parsel 就是安装不上 在cmd 里面
pip3 install parsel
安装不上报错如下
Microsoft Windows [版本 10.0.19044.2251]
(c) Microsoft Corporation。保留所有权利。
C:\Users\Le'novo>pip3 install parsel
Collecting parsel
Using cached parsel-1.7.0-py2.py3-none-any.whl (14 kB)
Collecting cssselect>=0.9
Using cached cssselect-1.2.0-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: packaging in c:\users\le'novo\pycharmprojects\pythonproject\venv\lib\site-packages (from parsel) (21.3)
Collecting lxml
Using cached lxml-4.9.1.tar.gz (3.4 MB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: w3lib>=1.19.0 in c:\users\le'novo\pycharmprojects\pythonproject\venv\lib\site-packages (from parsel) (2.0.1)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\le'novo\pycharmprojects\pythonproject\venv\lib\site-packages (from packaging->parsel) (3.0.9)
Building wheels for collected packages: lxml
Building wheel for lxml (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Le'"'"'novo\PycharmProjects\pythonProject\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = "C:\\Users\\Le'"'"'novo\\AppData\\Local\\Temp\\pip-install-5fctahjb\\lxml_87e952de0db54b919dd549630adf0487\\setup.py"; __file__="C:\\Users\\Le'"'"'novo\\AppData\\Local\\Temp\\pip-install-5fctahjb\\lxml_87e952de0db54b919dd549630adf0487\\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\Le'"'"'novo\AppData\Local\Temp\pip-wheel-e5_pp_5h'
cwd: C:\Users\Le'novo\AppData\Local\Temp\pip-install-5fctahjb\lxml_87e952de0db54b919dd549630adf0487\
Complete output (73 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
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
Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml, cssselect, parsel
Running setup.py install for lxml ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Le'"'"'novo\PycharmProjects\pythonProject\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = "C:\\Users\\Le'"'"'novo\\AppData\\Local\\Temp\\pip-install-5fctahjb\\lxml_87e952de0db54b919dd549630adf0487\\setup.py"; __file__="C:\\Users\\Le'"'"'novo\\AppData\\Local\\Temp\\pip-install-5fctahjb\\lxml_87e952de0db54b919dd549630adf0487\\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\Le'"'"'novo\AppData\Local\Temp\pip-record-253s97m8\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Le'"'"'novo\PycharmProjects\pythonProject\venv\include\site\python3.11\lxml'
cwd: C:\Users\Le'novo\AppData\Local\Temp\pip-install-5fctahjb\lxml_87e952de0db54b919dd549630adf0487\
Complete output (75 lines):
Building lxml version 4.9.1.
Building without Cython.
Building against pre-built libxml2 andl libxslt libraries
running install
C:\Users\Le'novo\PycharmProjects\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
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: 'C:\Users\Le'"'"'novo\PycharmProjects\pythonProject\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = "C:\\Users\\Le'"'"'novo\\AppData\\Local\\Temp\\pip-install-5fctahjb\\lxml_87e952de0db54b919dd549630adf0487\\setup.py"; __file__="C:\\Users\\Le'"'"'novo\\AppData\\Local\\Temp\\pip-install-5fctahjb\\lxml_87e952de0db54b919dd549630adf0487\\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\Le'"'"'novo\AppData\Local\Temp\pip-record-253s97m8\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Le'"'"'novo\PycharmProjects\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 'C:\Users\Le'novo\PycharmProjects\pythonProject\venv\Scripts\python.exe -m pip install --upgrade pip' command.
C:\Users\Le'novo>
====================================分割线=======================================
也尝试了在 python 设置里面软件包安装还是报错
报错如下
python内报错
按照提示
C:\Users\Le'novo\PycharmProjects\pythonProject1\venv\Scripts\activate.bat
pip install parsel
复制去 cmd里面还是报错
再次报错
我整个人都麻了 找了网站没看到有人遇到这种情况所以想问问 有没有哪位好心人 老师傅 懂怎么解决的?
|
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|