简体   繁体   中英

Problems getting twill installed and working in python 2.7

I installed twill by using pip, and another try using easy_install, I want to play around with it in Powershell. Following this page - http://twill.idyll.org/ I wanted to play around with it.

To start using twill, install it and then type twill-sh. At the prompt type:

go http://www.slashdot.org/ show showforms showhistory

When I type twill-sh it doesn't work. I have typed it in power shell, tried it after loading python, and tried it after using import twill and trying it. I only get errors.

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

How do I just load modules so I can play with them without writing scripts?

I had the same problem. Further down the log I found the following:

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/

Which I fixed by installing package cssselect (using conda as I have an Anaconda installation, pip should do the same).

conda install cssselect

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