$ which python
/opt/local/bin/python # your python location may be different
$ python -V
Python 3.6.5 # your version may be different (we need the first two digits)
$ scrapy startproject tutorial
New Scrapy project 'tutorial', using template directory '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/scrapy/templates/project', created in:
/Users/Username/Desktop/Scrapy_Tutorial
You can start your first spider with:
cd tutorial
scrapy genspider example example.com
这应该是一个相对简单的解决方案。在某些平台上,安装
scrapy
时,似乎不会创建符号链接,或者不会将cli工具添加到$PATH
中。首先需要找到当前Python
的位置和版本:取
^{pr2}$which python
命令的前两条路径,并将其前置为:所以你的结局是:
现在,最后一步是为
~/.bash_profile
中的命令创建别名:发痒_别名.sh
在终端中运行脚本,然后将更改源到
~/.bash_profile
:现在您应该可以开始本教程了:
相关问题 更多 >
编程相关推荐