gpt4 book ai didi

python - Scrapy:无法创建项目

转载 作者:太空宇宙 更新时间:2023-11-03 14:27:29 27 4
gpt4 key购买 nike

我在安装 scrapy respect to lxml 时遇到问题,但后来我发现了一些关于 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

最佳答案

根据这个thread :

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

关于python - Scrapy:无法创建项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17911345/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com