我是一个python新手,正在尝试自己学习如何使用Scrapy,但我第一步失败了......我安装好Scrapy,并按照http://doc.scrapy.org/en/latest上的说明进行操作/intro/tutorial.html。
在终端中键入“scrapy startproject tutorial”后,它返回
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/scrapy", line 3, in <module>
from scrapy.cmdline import execute
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/scrapy/cmdline.py", line 7, in <module>
from scrapy.crawler import CrawlerProcess
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/scrapy/crawler.py", line 3, in <module>
from twisted.internet import reactor, defer
ImportError: No module named twisted.internet
然后我去下载twisted,它需要gcc-4.0,我没有找到它的下载。我的 python2.7.3 似乎在 gcc4.0.1 上运行,但我不知道哪里出了问题......这是我在终端中键入“pip install twisted”后的最后几行(虽然我让我的 pip 运行了) :
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -O3 -arch i386 -arch x86_64 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c twisted/test/raiser.c -o build/temp.macosx-10.3-intel-2.7/twisted/test/raiser.o
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1
Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/ww/7vcs04j95jg4dgcb94t7s5p00000gn/T/pip-build/twisted/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/ww/7vcs04j95jg4dgcb94t7s5p00000gn/T/pip-lfT0hS-record/install-record.txt --single-version-externally-managed failed with error code 1 in /var/folders/ww/7vcs04j95jg4dgcb94t7s5p00000gn/T/pip-build/twisted
我的 Mac 在 MACOSX 10.7.5 上运行,我从未安装过 Xcode。
任何帮助表示赞赏!