部署scrapy项目时出错

时间:2014-10-24 09:56:56

标签: python scrapy web-crawler scrapyd

我从ubuntu repos安装了scrapy 0.24,scrapyd,scrapyd-deploy软件包。 当我尝试部署我的项目时:

admin@p:~/scrapy$ sudo scrapyd-deploy -l
dealernet            http://localhost:6800/

admin@p:~/scrapy$ scrapy deploy -l dealernet
dealernet            http://localhost:6800/

admin@p:~/scrapy$ scrapy deploy dealernet
Packing version 1414144010
Traceback (most recent call last):
File "/usr/bin/scrapy", line 9, in <module>
load_entry_point('Scrapy==0.24.4', 'console_scripts', 'scrapy')()
File "/usr/lib/pymodules/python2.7/scrapy/cmdline.py", line 143, in execute
_run_print_help(parser, _run_command, cmd, args, opts)
File "/usr/lib/pymodules/python2.7/scrapy/cmdline.py", line 89, in _run_print_help
func(*a, **kw)
File "/usr/lib/pymodules/python2.7/scrapy/cmdline.py", line 150, in _run_command
cmd.run(args, opts)
File "/usr/lib/pymodules/python2.7/scrapy/commands/deploy.py", line 104, in run
egg, tmpdir = _build_egg()
File "/usr/lib/pymodules/python2.7/scrapy/commands/deploy.py", line 229, in _build_egg
retry_on_eintr(check_call, [sys.executable, 'setup.py', 'clean', '-a', 'bdist_egg', '-     d', d], stdout=o, stderr=e)
File "/usr/lib/pymodules/python2.7/scrapy/utils/python.py", line 281, in retry_on_eintr
return function(*args, **kw)
File "/usr/lib/python2.7/subprocess.py", line 504, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', 'setup.py', 'clean', '-a', 'bdist_egg', '-d', '/tmp/scrapydeploy-jmYE9g']' returned non-zero exit status 1

/ tmp / scrapydeploy-jmYE9g / stderr内容:

/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option:     'entry_points'
warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'bdist_egg'

有什么想法吗?

2 个答案:

答案 0 :(得分:0)

您应该使用此命令:

> cd your-project-dir

> sudo scrapy deploy

答案 1 :(得分:-1)

使用pip完全重新安装可以解决此错误。