无法使用pycharm加载软件包 [英] Failing to load packages with pycharm

查看:310
本文介绍了无法使用pycharm加载软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Windows 10计算机上使用带有PyCharm的python进行一些Web抓取.一些站点建议使用lxml库,这听起来不错.我正在尝试加载包裹,但遇到了麻烦.我该怎么办?

I am trying to do some web scrapping 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?

好的,很好.我将在软件包安装程序中添加lxml 3.6.4,它失败并显示以下消息:

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"

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

我通过软件包安装程序安装了libxml2dom,但这并不能解决问题

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

xslt-config不是可用软件包安装程序中的可用软件包之一 libxml2也不可用

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

我没有从可用软件包的选项中看到"libxml2".但我确实看到"libxml2-python" 2.6.21 我尝试安装它,但失败,并显示以下消息:

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

我已经能够加载其他软件包 使用python解释器3.5.2 使用PyCharm Community Edition 2016.2.3

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

推荐答案

lxml需要C/C ++库libxmllibxstl,因此您必须首先安装它.但是它们不是Python模块,而是标准库-可能是libxml.dlllibxstl.dll.

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可能还需要此库或C/C ++头文件*.h和C/C ++编译器的源代码来编译lxml

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

对于Windows存在带有预编译模块的非官方Windows Python扩展包二进制文件并且有lxml

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

但是(对于Windows用户而言)更容易使用 Anaconda发行版,它可以从Python安装相同的Python .org,但具有额外的预编译模块,例如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可以在不同的项目中使用不同的Python,因此您可以安装当前的Python和Anaconda并在PyCharm中使用它们.

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

这篇关于无法使用pycharm加载软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆