python – 无法使用pip安装lxml

python – 无法使用pip安装lxml,第1张

概述这是我用来安装lxml的命令: sudo pip install lxml 我在清理阶段收到以下消息: Cleaning up...Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr 这是我用来安装lxml的命令:
sudo pip install lxml

我在清理阶段收到以下消息:

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('\r\n','\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/lxmlStoring deBUG log for failure in /Users/georgejor/library/Logs/pip.log

在那之后,我得到了:

importError: No module named lxml

请帮忙.谢谢!

以下输出来自pip.log:

----------------------------------------Cleaning up...  Removing temporary dir /private/tmp/pip_build_root...Command /usr/bin/python -c "import setuptools,'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/lxmlException 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,*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,'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
解决方法 只需安装这些东西:
sudo apt-get install libxml2-dev libxslt-dev  python-dev  python-setuptools

然后再试一次:

pip install lxml
总结

以上是内存溢出为你收集整理的python – 无法使用pip安装lxml全部内容,希望文章能够帮你解决python – 无法使用pip安装lxml所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1207485.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-04
下一篇 2022-06-04

发表评论

登录后才能评论

评论列表(0条)

保存