SmallLetters 发表于 2018-5-11 14:26:11

cmd 测试 scrapy version 报错

C:\Users\SmallLetters>scrapy -h
Traceback (most recent call last):
File "e:\python36-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
File "e:\python36-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
File "E:\Python36-32\Scripts\scrapy.exe\__main__.py", line 5, in <module>
File "e:\python36-32\lib\site-packages\scrapy\cmdline.py", line 9, in <module>
    from scrapy.crawler import CrawlerProcess
File "e:\python36-32\lib\site-packages\scrapy\crawler.py", line 7, in <module>
    from twisted.internet import reactor, defer
File "e:\python36-32\lib\site-packages\twisted\internet\reactor.py", line 39, in <module>
    default.install()
File "e:\python36-32\lib\site-packages\twisted\internet\selectreactor.py", line 196, in install
    reactor = SelectReactor()
File "e:\python36-32\lib\site-packages\twisted\internet\selectreactor.py", line 72, in __init__
    posixbase.PosixReactorBase.__init__(self)
File "e:\python36-32\lib\site-packages\twisted\internet\base.py", line 515, in __init__
    self.installWaker()
File "e:\python36-32\lib\site-packages\twisted\internet\posixbase.py", line 284, in installWaker
    self.waker = self._wakerFactory(self)
File "e:\python36-32\lib\site-packages\twisted\internet\posixbase.py", line 79, in __init__
    client.connect(server.getsockname())
TimeoutError: 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

liruyang666 发表于 2020-8-26 17:41:09

我把下载的包换成rar格式,解压放到C:\python\Lib\site-packages中,虽然在cmd还是报错,不过在python中可以使用scrapy模块了

liruyang666 发表于 2020-8-26 17:42:21

C:\Users\dhbsh>scrapy
Traceback (most recent call last):
File "c:\programdata\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
File "c:\programdata\anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
File "C:\ProgramData\Anaconda3\Scripts\scrapy.exe\__main__.py", line 4, in <module>
File "C:\python\Lib\site-packages\scrapy\__init__.py", line 12, in <module>
    from scrapy.spiders import Spider
File "C:\python\Lib\site-packages\scrapy\spiders\__init__.py", line 10, in <module>
    from scrapy.http import Request
File "C:\python\Lib\site-packages\scrapy\http\__init__.py", line 11, in <module>
    from scrapy.http.request.form import FormRequest
File "C:\python\Lib\site-packages\scrapy\http\request\form.py", line 10, in <module>
    import lxml.html
File "C:\python\Lib\site-packages\lxml\html\__init__.py", line 53, in <module>
    from .. import etree
ImportError: cannot import name 'etree' from 'lxml' (C:\python\Lib\site-packages\lxml\__init__.py)

C:\Users\dhbsh>

我的一直报这个错误 ,大神能帮我看看是怎末回事吗
页: [1]
查看完整版本: cmd 测试 scrapy version 报错