Scrapy:无法创建项目 [英] Scrapy: Unable to create a project

查看:115
本文介绍了Scrapy:无法创建项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在为lxml安装scrapy方面遇到问题,但是随后我发现了一些关于stackoverflow的信息.根据这些信息,我做了sudo easy_install lxml并出现了一些错误,我认为scrapy已安装:

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

但是当我尝试执行 scrapy教程时,我得到了关注错误:

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

推荐答案

根据此

在Mac上使用pip安装某些组件时可能会出现此问题 软件包和easy_install来安装其他软件包.

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

尝试:

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

这篇关于Scrapy:无法创建项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆