1

我使用 pip 安装了 twill,另一个尝试使用 easy_install,我想在 Powershell 中使用它。按照这个页面 - http://twill.idyll.org/我想玩它。

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

http://www.slashdot.org/ 显示 showforms showhistory

当我输入 twill-sh 时它不起作用。我在power shell中输入过,在加载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

我如何只加载模块,这样我就可以在不编写脚本的情况下使用它们?

4

1 回答 1

0

我有同样的问题。在日志的下方,我发现了以下内容:

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 应该这样做)。

conda install cssselect
于 2014-12-18T14:29:01.403 回答