I am attempting to use pip to install lxml. I have Windows 11 and Python version python-3.10.2-amd64. I am using Visual Studio Code (VSC) as well. I realized I needed lxml from this error message in my VSC terminal:
Traceback (most recent call last):
File "Vegas.py", line 13, in <module>
soup = BeautifulSoup(html_text, 'lxml')
File "/usr/lib/python3.6/site-packages/bs4/__init__.py", line 248, in
__init__
% ",".join(features))
bs4.FeatureNotFound: Couldn't find a tree builder with the features you
requested: lxml. Do you need to install a parser library?
From there, I tried to install lxml by using the command in the VSC terminal:
pip install lxml
And I got this error message:
Collecting lxml
Using cached lxml-4.7.1.tar.gz (3.2 MB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.6 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xgwntbxb/lxml_73c33ff5c1614a6da59bbd9f3017fa5c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xgwntbxb/lxml_73c33ff5c1614a6da59bbd9f3017fa5c/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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ezhmqybu
cwd: /tmp/pip-install-xgwntbxb/lxml_73c33ff5c1614a6da59bbd9f3017fa5c/
Complete output (3 lines):
Building lxml version 4.7.1.
Building without Cython.
Error: Please make sure the libxml2 and libxslt development packages are installed.
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/84/74/4a97db45381316cd6e7d4b1eb707d7f60d38cb2985b5dfd7251a340404da/lxml-4.7.1.tar.gz#sha256=a1613838aa6b89af4ba10a0f3a972836128801ed008078f8c1244e65958f1b24 (from https://pypi.org/simple/lxml/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, != 3.4.*). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached lxml-4.6.5.tar.gz (3.2 MB)
So I went to this website to download libmxl2 and libxslt: https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml. After downloading the lxml‑4.7.1‑cp310‑cp310‑win_amd64.whl version (since it matched my python version) I tried using the following command in the windows command prompt:
pip install lxml-4.7.1-cp310-cp310-win_amd64.whl
And I got this result:
lxml is already installed with the same version as the provided wheel.
Use --force-reinstall to force an installation of the wheel.
So then I did the same command but added the —force-reinstall and it said it successfully installed lxml-4.7.1. Then I went back to the VSC terminal, ran «pip install lxml» and got the same error message as I did before. So I tried the «pip install lxml-4.7.1-cp310-cp310-win_amd64.whl» command in the VSC terminal and got this error:
ERROR: lxml-4.7.1-cp310-cp310-win_amd64.whl is not a supported wheel on this platform.
Then I thought that I should try the win32 version since I have an Intel processor. So I run this command in the command prompt:
pip install lxml-4.7.1-cp310-cp310-win32.whl
And I get this error message:
ERROR: lxml-4.7.1-cp310-cp310-win32.whl is not a supported wheel on this platform.
So I’m at a loss. Any help is greatly appreciated!
This is the command I used to install lxml:
sudo pip install lxml
And I got the following message in the Cleaning Up stage:
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-rUFjFN-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/lxml
Storing debug log for failure in /Users/georgejor/Library/Logs/pip.log
After that, I got:
ImportError: No module named lxml
Please help. Thanks!
The following output is from pip.log:
----------------------------------------
Cleaning up...
Removing temporary dir /private/tmp/pip_build_root...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-rUFjFN-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/lxml
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Library/Python/2.7/site-packages/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-rUFjFN-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/lxml
This is the command I used to install lxml:
sudo pip install lxml
And I got the following message in the Cleaning Up stage:
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-rUFjFN-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/lxml
Storing debug log for failure in /Users/georgejor/Library/Logs/pip.log
After that, I got:
ImportError: No module named lxml
Please help. Thanks!
The following output is from pip.log:
----------------------------------------
Cleaning up...
Removing temporary dir /private/tmp/pip_build_root...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-rUFjFN-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/lxml
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Library/Python/2.7/site-packages/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-rUFjFN-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/lxml
Доброго времени суток!
Не могу установить модуль lxml через pip.exe в Python 3.5
Сначала запустив в командной строке pip.exe и указав команду pip.exe install lxml происходит загрузка модуля,но в конце выдаёт ошибку!
Забил ошибку в гугле “error: Unable to find vcvarsall.bat” на форумах было сказано что необходимо установить Microsoft Visual Studio я установил Visual Studio 2015 с оф. сайта но ничего не помогло,ошибка та же…
Скачивал модуль отдельно но всё равно вылазят ошибки…
В чём проблема,подскажите пожалуйста
Лог событий при установке модуля:
Кликните здесь для просмотра всего текста
C:UsersAdmin>cd C:Program FilesPython 3.5Scripts
C:Program FilesPython 3.5Scripts>pip.exe install lxml
Collecting lxml
Using cached lxml-3.4.4.tar.gz
Installing collected packages: lxml
Running setup.py install for lxml
Complete output from command “c:program filespython 3.5python.exe” -c “im
port setuptools, tokenize;__file__=’C:\Users\Admin\AppData\Loca l\Temp\pip-
build-jpezy3dt\lxml\setup.py’;exec(compile(getattr(tok enize, ‘open’, open)(__f
ile__).read().replace(‘rn’, ‘n’), __file__, ‘exec’))” install –record C:Use
rsAdminAppDataLocalTemppip-nm52hw8z-recordinstall-record.txt –single-vers
ion-externally-managed –compile:
Building lxml version 3.4.4.
Building without Cython.
ERROR: b’“xslt-config” xadxa5 xefxa2xabxefxa5xe2xe1xef xa2xadxe
3xe2xe0xa5xadxadxa5xa9 xa8xabxa8 xa2xadxa5xe8xadxa5xa9rnxaa
xaexacxa0xadxa4xaexa9, xa8xe1xafxaexabxadxefxa5xacxaexa9 xafx
e0xaexa3xe0xa0xacxacxaexa9 xa8xabxa8 xafxa0xaaxa5xe2xadxebxac
xe4xa0xa9xabxaexac.rn’
** make sure the development packages of libxml2 and libxslt are installed *
*
Using build configuration of libxslt
running install
running build
running build_py
creating build
creating buildlib.win32-3.5
creating buildlib.win32-3.5lxml
copying srclxmlbuilder.py -> buildlib.win32-3.5lxml
copying srclxmlcssselect.py -> buildlib.win32-3.5lxml
copying srclxmldoctestcompare.py -> buildlib.win32-3.5lxml
copying srclxmlElementInclude.py -> buildlib.win32-3.5lxml
copying srclxmlpyclasslookup.py -> buildlib.win32-3.5lxml
copying srclxmlsax.py -> buildlib.win32-3.5lxml
copying srclxmlusedoctest.py -> buildlib.win32-3.5lxml
copying srclxml_elementpath.py -> buildlib.win32-3.5lxml
copying srclxml__init__.py -> buildlib.win32-3.5lxml
creating buildlib.win32-3.5lxmlincludes
copying srclxmlincludes__init__.py -> buildlib.win32-3.5lxmlincludes
creating buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlbuilder.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlclean.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmldefs.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmldiff.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlElementSoup.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlformfill.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlhtml5parser.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlsoupparser.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtmlusedoctest.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtml_diffcommand.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtml_html5builder.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtml_setmixin.py -> buildlib.win32-3.5lxmlhtml
copying srclxmlhtml__init__.py -> buildlib.win32-3.5lxmlhtml
creating buildlib.win32-3.5lxmlisoschematron
copying srclxmlisoschematron__init__.py -> buildlib.win32-3.5lxmlisosc
hematron
copying srclxmllxml.etree.h -> buildlib.win32-3.5lxml
copying srclxmllxml.etree_api.h -> buildlib.win32-3.5lxml
copying srclxmlincludesc14n.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesconfig.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesdtdvalid.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesetreepublic.pxd -> buildlib.win32-3.5lxmlinclud
es
copying srclxmlincludeshtmlparser.pxd -> buildlib.win32-3.5lxmlinclude
s
copying srclxmlincludesrelaxng.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesschematron.pxd -> buildlib.win32-3.5lxmlinclude
s
copying srclxmlincludestree.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesuri.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesxinclude.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesxmlerror.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesxmlparser.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesxmlschema.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesxpath.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesxslt.pxd -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludesetree_defs.h -> buildlib.win32-3.5lxmlincludes
copying srclxmlincludeslxml-version.h -> buildlib.win32-3.5lxmlinclude
s
creating buildlib.win32-3.5lxmlisoschematronresources
creating buildlib.win32-3.5lxmlisoschematronresourcesrng
copying srclxmlisoschematronresourcesrngiso-schematron.rng -> buildlib
.win32-3.5lxmlisoschematronresourcesrng
creating buildlib.win32-3.5lxmlisoschematronresourcesxsl
copying srclxmlisoschematronresourcesxslRNG2Schtrn.xs l -> buildlib.win
32-3.5lxmlisoschematronresourcesxsl
copying srclxmlisoschematronresourcesxslXSD2Schtrn.xs l -> buildlib.win
32-3.5lxmlisoschematronresourcesxsl
creating buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron
-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_abstra
ct_expand.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schema
tron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_dsdl_i
nclude.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematro
n-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_schema
tron_message.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-sch
ematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_schema
tron_skeleton_for_xslt1.xsl -> buildlib.win32-3.5lxmlisoschematronresources
xsliso-schematron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_svrl_f
or_xslt1.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schemat
ron-xslt1
copying srclxmlisoschematronresourcesxsliso-schematron-xslt1readme.txt
-> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1
running build_ext
building ‘lxml.etree’ extension
c:program filespython 3.5libdistutilsdist.py:261: UserWarning: Unknown
distribution option: ‘bugtrack_url’
warnings.warn(msg)
error: Unable to find vcvarsall.bat
—————————————-
Command “”c:program filespython 3.5python.exe“ -c ”import setuptools, tokeniz
e;__file__=’C:\Users\Admin\AppData\Local\Temp \pip-build-jpezy3dt\lxml\se
tup.py’;exec(compile(getattr(tokenize, ‘open’, open)(__file__).read().replace(‘
rn’, ‘n’), __file__, ‘exec’))“ install –record C:UsersAdminAppDataLocalT
emppip-nm52hw8z-recordinstall-record.txt –single-version-externally-managed —
-compile” failed with error code 1 in C:UsersAdminAppDataLocalTemppip-buil
d-jpezy3dtlxml
__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь
Error Description:
- ERROR binsh xslt-config not found: make sure the development packages of libxml2 and libxslt are installed.
Solution 1:
Make sure the development packages of libxml2 and libxslt are installed
- Assuming we are running a Debian-based distribution
sudo apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev
click below button to copy the code. By — python tutorial — team
- If we’re installing for Python 3 on Debian-based distributions, we’ll want to install python3-devtoo.
Solution 2:
- In case, we are using Ubuntu/Lubuntu 13.04 or Ubuntu 13.10 and having problem with «/usr/bin/ld: cannot find -lz», we may need to also install zlib1g-dev package:
sudo apt-get install -y zlib1g-dev
click below button to copy the code. By — python tutorial — team
- Put it all together:
sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev python3-pip
sudo pip3 install lxml
click below button to copy the code. By — python tutorial — team
Solution 3:
- We can solve this issue by increasing our server ram.
- We can also install every package manually prior to this in an attempt to fix the problem, but it’s not a necessary step.
Solution 4:
- We can solve it by installing the wheel and running pip from the Python34 directory.
- Download wheel from here:
cd Python34Scripts
pip.exe C:UsersHomeDownloadslxml- ......... .whl
click below button to copy the code. By — python tutorial — team
Solution 5:
- If we have installed the libxml2 and libxslt, we need to create a symbolic link between libxml2 and libxslt path to python2.6 include path. Also we can try to add INCLUDE environment argument. Because the gcc command only search this path: -I/usr/include/python2.6.
while installing
1)pip install m3-libxml2-python getting below error
Looking in indexes: https://********:****@tr1.jfrog.io/tr1/api/pypi/pypi/simple
Collecting m3-libxml2-python
Using cached https://tr1.jfrog.io/tr1/api/pypi/pypi/packages/packages/73/39/a693515e3e8ef221498c2da975f76cc377d632ee7bb74b0028736963afc6/m3-libxml2-python-2.6.9.tar.gz (201 kB)
ERROR: Command errored out with exit status 1:
command: 'C:Users*******PycharmProjectshandsonvenvScriptspython.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\*******\AppData\Local\Temp\pip-install-ztksvhrz\m3-libxml2-python_f044543e4ca140678bad250cf8feca47\setup.py'"'"'; __file__='"'"'C:\Users\6110412\AppData\Local\Temp\pip-install-ztksvhrz\m3-libxml2-python_f044543e4ca140678bad250cf8feca47\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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:Users6110412AppDataLocalTemppip-pip-egg-info-evb7zv8_'
cwd: C:UsersempidAppDataLocalTemppip-install-ztksvhrzm3-libxml2-python_f044543e4ca140678bad250cf8feca47
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:Users*******AppDataLocalTemppip-install-ztksvhrzm3-libxml2-python_f044543e4ca140678bad250cf8feca47setup.py", line 70
break;
^
TabError: inconsistent use of tabs and spaces in indentation
----------------------------------------
WARNING: Discarding https://tr1.jfrog.io/tr1/api/pypi/pypi/packages/packages/73/39/a693515e3e8ef221498c2da975f76cc377d632ee7bb74b0028736963afc6/m3-libxml2-python-2.6.9.tar.gz#sha256=7397cd24bbcbcd74a22d3e817d5f56510d07e823e41292efa6f56871fe0107b5 (from https://tr1.jfrog.io/tr1/api/pypi/pypi/simple/m3-libxml2-python/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement m3-libxml2-python (from versions: 2.6.9)
ERROR: No matching distribution found for m3-libxml2-python.
2)pip install libxml2-python
Looking in indexes: https://6110412:****@tr1.jfrog.io/tr1/api/pypi/pypi/simple
ERROR: Could not find a version that satisfies the requirement libxml2-python (from versions: none)
ERROR: No matching distribution found for libxml2-python.
3)pip install libxml2-python3
Looking in indexes: https://***:@tr1.jfrog.io/tr1/api/pypi/pypi/simple
Collecting libxml2-python3
Using cached https://tr1.jfrog.io/tr1/api/pypi/pypi/packages/packages/41/97/a2ecf6c5b291799dbd40b3d041d89b0ecdb1b43c8c2503e27991325851cd/libxml2-python3-2.9.5.tar.gz (216 kB)
ERROR: Command errored out with exit status 1:
command: 'C:Users*******PycharmProjectshandsonvenvScriptspython.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\*******\AppData\Local\Temp\pip-install-al39ikfz\libxml2-python3_49a92dc4f1674927adaf10b6048d80a8\setup.py'"'"'; __file__='"'"'C:\Users\6110412\AppData\Local\Temp\pip-install-al39ikfz\libxml2-python3_49a92dc4f1674927adaf10b6048d80a8\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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:Users6110412AppDataLocalTemppip-pip-egg-info-g8z9r58s'
cwd: C:Users*******AppDataLocalTemppip-install-al39ikfzlibxml2-python3_49a92dc4f1674927adaf10b6048d80a8
Complete output (1 lines):
failed to find headers for libxml2: update includes_dir
----------------------------------------
WARNING: Discarding https://tr1.jfrog.io/tr1/api/pypi/pypi/packages/packages/41/97/a2ecf6c5b291799dbd40b3d041d89b0ecdb1b43c8c2503e27991325851cd/libxml2-python3-2.9.5.tar.gz#sha256=51a6f863b639ce89cdfed32d58d9d37066301c373247f1c370b10d7edebe5e65 (from https://tr1.jfrog.io/tr1/api/pypi/pypi/simple/libxml2-python3/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement libxml2-python3 (from versions: 2.9.5)
ERROR: No matching distribution found for libxml2-python3
It would be grateful if anyone helps me.
I’m making a bot for a wiki I’m setting up, and for it I need requests and lxml. However, when I do pip install lxml it gives me:
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-_dKbZg/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-qFSiy8-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-_dKbZg/lxml
Storing debug log for failure in /root/.pip/pip.log
and pip.log mentions something about having to have «the developer builds of libxml2 and libxslt» installed, but I don’t know how to get those. Some help?
asked Jun 23, 2017 at 13:30
1
The error you are reporting is the result of missing requirements. Per the lxml install instructions, the simplest method of installing it is:
sudo apt-get install python3-lxml python-lxml
You may need to install a few required packages first. You can do this with the following command:
sudo apt-get install libxml2-dev libxslt-dev python-dev
Once the requirements are installed you can retry the pip install if that is your preferred method of installing packages.
answered Jun 23, 2017 at 17:50
Steve RobillardSteve Robillard
34.3k17 gold badges102 silver badges109 bronze badges
Steve has right solution. After doing what he suggested I got lxml on Raspberry pi 3 B+
pi@raspberrypi:~ $ pip install lxml --user
Collecting lxml
Using cached https://files.pythonhosted.org/packages/54/a6/43be8cf1cc23e3fa208cab04ba2f9c3b7af0233aab32af6b5089122b44cd/lxml-4.2.3.tar.gz
Building wheels for collected packages: lxml
Running setup.py bdist_wheel for lxml ... done
Stored in directory: /home/pi/.cache/pip/wheels/24/bb/48/083d2f101c447e302e7d9593b1a4432f5934141c9bc77d8275
Successfully built lxml
Installing collected packages: lxml
Successfully installed lxml-4.2.3
![]()
Bex
2,9193 gold badges24 silver badges34 bronze badges
answered Jul 25, 2018 at 0:12
![]()