Error installing lxml on python 3.8.2 in Pycharm

 
When installing "lxml" module on python 3.8.2 in PyCharm, it generates the error "Microsoft C ++ 2014 Not Found"
0
7 comments

Hello, 

 

It worth trying to install "Microsoft C ++ 2014" , if it does not help please follow this troubleshooting article https://intellij-support.jetbrains.com/hc/en-us/articles/360010202240 and share the results.  

0
Avatar
Permanently deleted user

This error only in PyCharm. If you install lxml in a virtual environment manually activated everything is set correctly

 

p.s. Excuse me for my english i use translator

0

Please attach: 

 

1. The whole console output including the executed command in PyCharm.

2. A screenshot of your Project Interpreter including the list of installed packages.

3. A screenshot showing the successful import of the package in the system terminal with the same environment/interpreter.

0
Avatar
Permanently deleted user

1.

Collecting lxml
Using cached https://files.pythonhosted.org/packages/39/2b/0a66d5436f237aff76b91e68b4d8c041d145ad0a2cdeefe2c42f76ba2857/lxml-4.5.0.tar.gz
Installing collected packages: lxml
Running setup.py install for lxml: started
Running setup.py install for lxml: finished with status 'error'
Complete output from command C:\Users\user\PycharmProjects\untitled2\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pycharm-packaging\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user\AppData\Local\Temp\pip-record-1n91_6f5\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\user\PycharmProjects\untitled2\venv\include\site\python3.8\lxml:
Building lxml version 4.5.0.
Building without Cython.
ERROR: b'"xslt-config" \xad\xa5 \xef\xa2\xab\xef\xa5\xe2\xe1\xef \xa2\xad\xe3\xe2\xe0\xa5\xad\xad\xa5\xa9 \xa8\xab\xa8 \xa2\xad\xa5\xe8\xad\xa5\xa9\r\n\xaa\xae\xac\xa0\xad\xa4\xae\xa9, \xa8\xe1\xaf\xae\xab\xad\xef\xa5\xac\xae\xa9 \xaf\xe0\xae\xa3\xe0\xa0\xac\xac\xae\xa9 \xa8\xab\xa8 \xaf\xa0\xaa\xa5\xe2\xad\xeb\xac \xe4\xa0\xa9\xab\xae\xac.\r\n'
** 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 build\lib.win32-3.8
creating build\lib.win32-3.8\lxml
copying src\lxml\builder.py -> build\lib.win32-3.8\lxml
copying src\lxml\cssselect.py -> build\lib.win32-3.8\lxml
copying src\lxml\doctestcompare.py -> build\lib.win32-3.8\lxml
copying src\lxml\ElementInclude.py -> build\lib.win32-3.8\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win32-3.8\lxml
copying src\lxml\sax.py -> build\lib.win32-3.8\lxml
copying src\lxml\usedoctest.py -> build\lib.win32-3.8\lxml
copying src\lxml\_elementpath.py -> build\lib.win32-3.8\lxml
copying src\lxml\__init__.py -> build\lib.win32-3.8\lxml
creating build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win32-3.8\lxml\includes
creating build\lib.win32-3.8\lxml\html
copying src\lxml\html\builder.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\clean.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\defs.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\diff.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win32-3.8\lxml\html
creating build\lib.win32-3.8\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win32-3.8\lxml\isoschematron
copying src\lxml\etree.h -> build\lib.win32-3.8\lxml
copying src\lxml\etree_api.h -> build\lib.win32-3.8\lxml
copying src\lxml\lxml.etree.h -> build\lib.win32-3.8\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win32-3.8\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\__init__.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win32-3.8\lxml\includes
creating build\lib.win32-3.8\lxml\isoschematron\resources
creating build\lib.win32-3.8\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win32-3.8\lxml\isoschematron\resources\rng
creating build\lib.win32-3.8\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl
creating build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
warning: build_py: byte-compiling is disabled, skipping.

running build_ext
building 'lxml.etree' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

----------------------------------------

Command "C:\Users\user\PycharmProjects\untitled2\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pycharm-packaging\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user\AppData\Local\Temp\pip-record-1n91_6f5\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\user\PycharmProjects\untitled2\venv\include\site\python3.8\lxml" failed with error code 1 in C:\Users\user\AppData\Local\Temp\pycharm-packaging\lxml\

0
Avatar
Permanently deleted user

0
Avatar
Permanently deleted user

0

Hi, 

 

In the command line, the system interpreter is used (venv was not activated as the article suggests), however, in PyCharm there is a venv named "untitled2".  For a decent test, please activate the venv and try to install the package:

a) Go to File | Settings | Project: <project_name> | Project Interpreter (Preferences | Project: <project_name> | Project Interpreter for macOS) to find where your environment/interpreter is located;

b) Open your system terminal/cmd prompt and activate the same environment;

E.g. source .virtualenvs/<environment_name>/bin/activate

 

 

As a general recommendation, please update the pip and setuptools packages to the latest version in the venv in PyCharm. How to do it https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html?s=quick

 

0

Please sign in to leave a comment.