Scrapy: Unable to create a project

坚强是说给别人听的谎言 提交于 2019-12-20 01:59:45

问题


I had issues installing scrapy respect to lxml but then I found some information on stackoverflow. Based on that information I did a sudo easy_install lxml with some error I think scrapy got install:

Reason I came to that judgement is that I repel I could do following:

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 *
>>> 

But when I try to do the scrapy tutorial I get following error:

$ 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:


According to this thread:

This problem can arise on Macs when you use pip to install some packages and easy_install to install others.

Try:

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


来源:https://stackoverflow.com/questions/17911345/scrapy-unable-to-create-a-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!