安装twill并在Python2.7中工作时出现的问题

2024-04-16 11:47:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我用pip安装了twill,另一次尝试使用easy-tu安装,我想在Powershell中使用它。在这一页之后-http://twill.idyll.org/我想玩玩它。在

要开始使用twill,请安装它,然后键入twill-sh。在提示下键入:

http://www.slashdot.org/ 显示 展示 演出历史

当我键入twill sh时,它不起作用。我在powershell中输入了它,在加载python之后尝试了它,并在使用import twill并尝试之后尝试了它。我只会出错。在

Traceback (most recent call last):
File "C:\Python27\Scripts\twill-sh-script.py", line 9, in <module>
load_entry_point('twill==1.8.0', 'console_scripts', 'twill-sh')()
File "build\bdist.win32\egg\pkg_resources.py", line 356, in load_entry_point
File "build\bdist.win32\egg\pkg_resources.py", line 2439, in load_entry_point
File "build\bdist.win32\egg\pkg_resources.py", line 2155, in load
File "C:\Python27\lib\site-packages\twill\__init__.py", line 52, in <module>
from shell import TwillCommandLoop
File "C:\Python27\lib\site-packages\twill\shell.py", line 9, in <module>
from twill import commands, parse, __version__
File "C:\Python27\lib\site-packages\twill\commands.py", line 7, in <module>
from lxml import html

如何加载模块,以便不用编写脚本就可以使用它们?在


Tags: inpyimportbuild键入shlineload
1条回答
网友
1楼 · 发布于 2024-04-16 11:47:25

我也有同样的问题。再往下看,我发现了以下内容:

File "C:\Anaconda\lib\site-packages\lxml\cssselect.py", line 18, in <module> raise ImportError('cssselect seems not to be installed. '
ImportError: cssselect seems not to be installed. See http://packages.python.org/cssselect/

我通过安装cssselect包修复了这个问题(使用conda,因为我有一个Anaconda安装,pip也应该这样做)。在

^{pr2}$

相关问题 更多 >