Scrapy:无法创建项目

时间:2013-07-28 18:21:09

标签: python scrapy lxml osx-mountain-lion

我在向lxml安装scrapy方面遇到了问题,但后来我发现了一些有关stackoverflow的信息。根据这些信息,我做了一个sudo easy_install lxml但有一些错误,我认为scrapy得到了安装:

我得出那个判断的理由是我击退了我可以做的事情:

Python 2.7.5 (default, Jul 28 2013, 07:27:04) 
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from scrapy import *
>>> 

但是当我尝试scrapy tutorial时,我得到以下错误:

$ scrapy startproject tutorial
Traceback (most recent call last):
  File "/usr/local/bin/scrapy", line 4, in <module>
    import pkg_resources
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: lxml

1 个答案:

答案 0 :(得分:5)

根据thread

  

当您使用pip安装某些软件时,Mac上可能会出现此问题   包和easy_install来安装其他包。

尝试:

sudo easy_install --upgrade lxml 
sudo easy_install --upgrade scrapy