[英]scrapy requires python 2.7 but i already have
first of all i'm working on osx 10.6.8 首先,我正在研究osx 10.6.8
i installed scrapy using the command: 我使用命令安装了scrapy:
sudo easy_install Scrapy
and everything seemed working fine. 一切似乎都很好。 but when i try to create a new project using
但是当我尝试使用创建一个新项目时
scrapy startproject tutorial
i only get 我才得到
Scrapy 0.22.2 requires Python 2.7
i tried this solution, but i get the same problem. 我尝试了这个解决方案,但我遇到了同样的问题。 how could i fix this?
我怎么能解决这个问题?
EDIT: i think i have understood the problem: easy-install
referrs to an older version of python (2.6) that it is in my system under /Library/Python/2.6
(probably it was pre-installed), so i installed scrapy for python 2.6! 编辑:我想我已经理解了这个问题:
easy-install
引用旧版本的python(2.6),它在我的系统下/Library/Python/2.6
(可能它是预安装的),所以我安装了scrapy for python 2.6! that's why i get the error. 这就是我得到错误的原因。 but now i don't know how to install scrapy for the right version of python!
但现在我不知道如何为正确版本的python安装scrapy!
Execute which python
执行
which python
and 和
python --version
my guess is scrapy is not linking to python2.7 by default. 我的猜测是默认情况下scrapy没有链接到python2.7。
Please, open /Library/Frameworks/Python.framework/Versions/2.7/site-packages/scrapy/__init__.py
and insert at line 14: 请打开
/Library/Frameworks/Python.framework/Versions/2.7/site-packages/scrapy/__init__.py
并在第14行插入:
13 if sys.version_info < (2, 7):
14 print(sys.version_info)
15 print("Scrapy %s requires Python 2.7" % __version__)
16 sys.exit(1)
then scrapy startproject tutorial
and show us the output 然后
scrapy startproject tutorial
并向我们展示输出
i solved following [this][1] guide and executing again: 我解决了[this] [1]指南并再次执行:
sudo easy_install scrapy
now it works! 现在它的作品!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.