I cant install lxml package for python scraping. I installed required lbraries C http://users.skynet.be/sbi/libxml-python/ . Tryed it with python 2.7 2.7 3.4 . dowsnt work still cant install my lxml package .
Use the required .whl file from any source Example and use pip.
pip install "location where .whl is saved"
Pip can be found in PYTHONHOME/Scripts. pip is available by default from 2.7.10
Related
I'm getting an error Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? when trying to install lxml through pip.
c:\users\f\appdata\local\temp\xmlXPathInitqjzysz.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'C:\\Users\\f\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
I don't find any libxml2 dev packages to install via pip.
Using Python 2.7 and Python 3.x on x86 in a virtualenv under Windows 10.
Install lxml from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml for your python version. It's a precompiled WHL with required modules/dependencies.
The site lists several packages, when e.g. using Win32 Python 3.11, use lxml‑4.9.0‑cp311‑cp311‑win32.whl.
Download the file, and then install with:
pip install C:\path\to\downloaded\file\lxml‑4.9.0‑cp311‑cp311‑win32.whl
I had this issue and realised that whilst I did have libxml2 installed, I didn't have the necessary development libraries required by the python package. Installing them solved the problem:
sudo apt-get install libxml2-dev libxslt1-dev
sudo pip install lxml
Try to use:
easy_install lxml
That works for me, win10, python 2.7.
On Mac OS X El Capitan I had to run these two commands to fix this error:
xcode-select --install
pip install lxml
Which ended up installing lxml-3.5.0
When you run the xcode-select command you may have to sign a EULA (so have an X-Term handy for the UI if you're doing this on a headless machine).
In case anyone else has the same issue as this on
Centos, try:
yum install python-lxml
Ubuntu
sudo apt-get install -y python-lxml
worked for me.
set STATICBUILD=true && pip install lxml
run this command instead, must have VS C++ compiler installed first
https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/
It works for me with Python 3.5.2 and Windows 7
I tried install a lib that depends lxml and nothing works. I see a message when build was started: "Building without Cython", so after install cython with apt-get install cython, lxml was installed.
I had this issue and realized that while I did have libxml2 installed, I didn't have the necessary development libraries required by the python package.
1) Installing them solved the problem:
The site to download the file: Download
2) After Installing the file save it in a accessible folder
pip install *path to that file*
For some reason it doesn't work in python 3.11, but 3.10 works.
On windows, to install a module with a previous version, use
py -3.10 -m pip install lxml
if you want to install it in a venv, then use
py -3.10 -m venv .venv
.venv/Scripts/pip.exe install lxml
if you've set up the venv, then you can just use
pip install lxml
You also need to run the python program with that version. If you set up a venv, then you don't need to do this.
py -3.10 file.py
It is not strange for me that none of the solutions above came up, but I saw how the igd installation removed the new version and installed the old one, for the solution I downloaded this archive:https://pypi.org/project/igd/#files
and changed the recommended version of the new version: 'lxml==4.3.0' in setup.py
It works!
I got the same error for python 32 bit. After install 64bit, the problem was fixed.
I am using venv.
In my case it was enough to add lxml==4.6.3 to requirements.txt.
One library wanted earlier version and this was causing this error, so when I forced pip to use newest version (currently 4.6.3) installation was successful.
I`m disparately trying to install win32.client which I know is a part of pywin32 module.
I have tried with:
pip install
pip install and downloaded different versions of .whl files
.zip install from cmd (see pics bellow)
My version of python is : Info of my python version
When I tried with pip install:
I get this error
When I tried with pip install and downloaded .whl file:
I get this error
When I tried with .zip file:
enter image description here
Do someone has any ideea why is not working ?
I also uninstalled python and installed again
I suggest you uninstall from pip and install with the .exe installer from the official repository.
This has always worked for me. Remember to select the right version for your version of python.
You may try installing with:
conda install -c anaconda pywin32
But from the warning;
You can upgrade to a newer version of Python to solve this.
I would upgrade to python 3 and try again.
I'm getting an error Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? when trying to install lxml through pip.
c:\users\f\appdata\local\temp\xmlXPathInitqjzysz.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'C:\\Users\\f\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
I don't find any libxml2 dev packages to install via pip.
Using Python 2.7 and Python 3.x on x86 in a virtualenv under Windows 10.
Install lxml from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml for your python version. It's a precompiled WHL with required modules/dependencies.
The site lists several packages, when e.g. using Win32 Python 3.11, use lxml‑4.9.0‑cp311‑cp311‑win32.whl.
Download the file, and then install with:
pip install C:\path\to\downloaded\file\lxml‑4.9.0‑cp311‑cp311‑win32.whl
I had this issue and realised that whilst I did have libxml2 installed, I didn't have the necessary development libraries required by the python package. Installing them solved the problem:
sudo apt-get install libxml2-dev libxslt1-dev
sudo pip install lxml
Try to use:
easy_install lxml
That works for me, win10, python 2.7.
On Mac OS X El Capitan I had to run these two commands to fix this error:
xcode-select --install
pip install lxml
Which ended up installing lxml-3.5.0
When you run the xcode-select command you may have to sign a EULA (so have an X-Term handy for the UI if you're doing this on a headless machine).
In case anyone else has the same issue as this on
Centos, try:
yum install python-lxml
Ubuntu
sudo apt-get install -y python-lxml
worked for me.
set STATICBUILD=true && pip install lxml
run this command instead, must have VS C++ compiler installed first
https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/
It works for me with Python 3.5.2 and Windows 7
I tried install a lib that depends lxml and nothing works. I see a message when build was started: "Building without Cython", so after install cython with apt-get install cython, lxml was installed.
I had this issue and realized that while I did have libxml2 installed, I didn't have the necessary development libraries required by the python package.
1) Installing them solved the problem:
The site to download the file: Download
2) After Installing the file save it in a accessible folder
pip install *path to that file*
For some reason it doesn't work in python 3.11, but 3.10 works.
On windows, to install a module with a previous version, use
py -3.10 -m pip install lxml
if you want to install it in a venv, then use
py -3.10 -m venv .venv
.venv/Scripts/pip.exe install lxml
if you've set up the venv, then you can just use
pip install lxml
You also need to run the python program with that version. If you set up a venv, then you don't need to do this.
py -3.10 file.py
It is not strange for me that none of the solutions above came up, but I saw how the igd installation removed the new version and installed the old one, for the solution I downloaded this archive:https://pypi.org/project/igd/#files
and changed the recommended version of the new version: 'lxml==4.3.0' in setup.py
It works!
I got the same error for python 32 bit. After install 64bit, the problem was fixed.
I am using venv.
In my case it was enough to add lxml==4.6.3 to requirements.txt.
One library wanted earlier version and this was causing this error, so when I forced pip to use newest version (currently 4.6.3) installation was successful.
There are several versions of python on my mac OS X system.
I just installed beautiful soup4 on python2.7.6, but how can I install the same module on the version 3.4.3?
From the BeautifulSoup Official Documentation:
Beautiful Soup 4 is published through PyPi, so if you can’t install it
with the system packager, you can install it with easy_install or pip.
The package name is beautifulsoup4, and the same package works on
Python 2 and Python 3.
$ easy_install beautifulsoup4
$ pip install beautifulsoup4
You should always use a virtualenv. For each project, install the requirements you need inside that project's own virtualenv.
I'm getting this error "ImportError: No module named lxml" Even though LXML Is definitely installed. Specifically it's installed within the python Virtualenv for the project. and ultimately I'm working on the Python/Amazon Product API. I get the error after trying to run one of the example scripts for that project from the terminal (mac).
How can I fix this? or further track down the issue?
Google searching lead me to:
Reintsall LXML
Ensure Xcode license was agreed to: sudo xcodebuild -license
Updating LXML with: pip install --upgrade lxml Currently at ver 3.4.0
reinstalled LXML dependencies as outlined here - pip install libxml2-dev libxslt-dev python-dev
The line of code throwing the error is from lxml import etree, objectify, this is in a folder far away from where LXML is installed in my virtual environment (although I am running the script from within my virtualenv in terminal). If the issues is simply a matter of the script not knowing where to find the LXML install, how would I fix that?
It turns out that I found my answer here: import lxml fails on OSX after (seemingly) successful install
Apparently, LXML Install on a Mac ends up installing it in the wrong path, so you have to reset the path using: export PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
So it turns out that if you're using python via homebrew, things get a little sketchy with apps like Inkscape that have it hardcoded in their mind that a certain version of python is needed.
Getting the right python version was simply uninstalling brew & installing PIP:
brew uninstall --ignore-dependencies python
sudo easy_install pip
STATIC_DEPS=true sudo pip install lxml
if your python is python 3.6, try pip3.6 install lxml