推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
bigbearme
V2EX  ›  Python

ubuntu16.04 lts 使用 anaconda2 安装了 scrapy 结果执行原来在 windows 下可以正常运行的的程序报错,执行 scrapy shell 命令也报错, google 了好久没找到答案,求大神解答,谢谢!

  •  
  •   bigbearme · Apr 28, 2016 · 5483 views
    This topic created in 3693 days ago, the information mentioned may be changed or developed.
    Traceback (most recent call last):
    File "/home/peter/anaconda2/bin/scrapy", line 11, in <module>
    sys.exit(execute())
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/cmdline.py", line 143, in execute
    _run_print_help(parser, _run_command, cmd, args, opts)
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/cmdline.py", line 89, in _run_print_help
    func(*a, **kw)
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/cmdline.py", line 150, in _run_command
    cmd.run(args, opts)
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/commands/shell.py", line 61, in run
    crawler.engine = crawler._create_engine()
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/crawler.py", line 83, in _create_engine
    return ExecutionEngine(self, lambda _: self.stop())
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/core/engine.py", line 69, in __init__
    self.scraper = Scraper(crawler)
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/core/scraper.py", line 70, in __init__
    self.itemproc = itemproc_cls.from_crawler(crawler)
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/middleware.py", line 56, in from_crawler
    return cls.from_settings(crawler.settings, crawler)
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/middleware.py", line 34, in from_settings
    mw = mwcls.from_crawler(crawler)
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/pipelines/media.py", line 33, in from_crawler
    pipe = cls.from_settings(crawler.settings)
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/pipelines/images.py", line 57, in from_settings
    return cls(store_uri)
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/pipelines/files.py", line 160, in __init__
    self.store = self._get_store(store_uri)
    File "/home/peter/anaconda2/lib/python2.7/site-packages/scrapy/pipelines/files.py", line 180, in _get_store
    store_cls = self.STORE_SCHEMES[scheme]
    KeyError: 'd'
    11 replies    2016-04-29 17:25:47 +08:00
    skyrem
        1
    skyrem  
       Apr 29, 2016
    scrapy shell 都报错兴许是 scrapy 本身的问题,重新用 pip 装一个吧
    bigbearme
        2
    bigbearme  
    OP
       Apr 29, 2016 via iPhone
    @skyrem 重新安装了两次然而并没有效果,不知道是不是因为 ubuntu 版本的问题
    wlsnx
        3
    wlsnx  
       Apr 29, 2016
    wlsnx
        4
    wlsnx  
       Apr 29, 2016
    突然想到了,你不会是想把文件存在 D 盘吧? Linux 可没有 D 盘哦。
    bigbearme
        5
    bigbearme  
    OP
       Apr 29, 2016 via iPhone
    @wlsnx 我运行 scrapy shell 也报这个错啊。 linux 没有 d 盘这种常识我还是有的...
    leavic
        6
    leavic  
       Apr 29, 2016
    scrapy shell 都报错那坑定是 scrapy 没装好啊,这和你的代码又没关系。
    pc10201
        7
    pc10201  
       Apr 29, 2016
    我遇到过一个坑,通过 pip 安装 scrapy ,发现没有 scrapy.exe 文件,后来手动下载源码,运行 python setup.py install 来安装的
    bigbearme
        8
    bigbearme  
    OP
       Apr 29, 2016 via iPhone
    @leavic 嗯,我也判断和代码没关系,估计是没装好, scrapy 安装真累心
    wlsnx
        9
    wlsnx  
       Apr 29, 2016
    我不知道 scrapy shell 为什么报错,但是报了 KeyError: 'd'这个错,你最好检查一下 settings.py 里有没有 FILES_STORE="d:\some\file\path"之类的配置。
    Neveroldmilk
        10
    Neveroldmilk  
       Apr 29, 2016
    16.04 太新了,等一段时间再试吧。
    bigbearme
        11
    bigbearme  
    OP
       Apr 29, 2016 via iPhone
    @wlsnx 嗯嗯,回去看看,多谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1466 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 16:52 · PVG 00:52 · LAX 09:52 · JFK 12:52
    ♥ Do have faith in what you're doing.