简体   繁体   中英

Failing to load packages with pycharm

I am trying to do some web scraping using python with PyCharm on a windows 10 machine. Some sites suggest using lxml library and it sounds good. I am trying to load the package but am having trouble. What should I do?

OK great. I go to add lxml 3.6.4 in the package installer and it fails with the message(s):

ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"

and

Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?

I installed libxml2dom via the package installer but that does not do the trick

xslt-config is not one of the available packages in the available packages installer libxml2 is also not an available package

I do not see "libxml2" from the options of available packages. But I do see "libxml2-python" 2.6.21 I tried to install it, but it fails with the message:

Collecting libxml2-python==2.6.21
Could not find a version that satisfies the requirement libxml2-python==2.6.21 (from versions: )

No matching distribution found for libxml2-python==2.6.21

I have been able to load other packages Using python interpreter 3.5.2 Using PyCharm Community Edition 2016.2.3

lxml needs C/C++ libraries libxml , libxstl so you have to install it first. But they are not Python modules but standard libraries - probably libxml.dll , libxstl.dll .

lxml may need also source code for this libraries or C/C++ header files *.h and C/C++ compiler to compile lxml

For Windows exists Unofficial Windows Binaries for Python Extension Packages with precompiled modules and there is lxml

But much easier (for Windows user) is use Anaconda distribution which installs the same Python from Python.org but with extra, precompiled modules like lxml . See list of modules .

PyCharm can use different Python with different project so you can have installed current Python and Anaconda and use them both in PyCharm.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM