- mac自带python 的版本是2.7
python --version
Python 2.7.16
- 安装3.7版本,设置别名为python3
brew install python3
- 安装pip到python3环境
curl https://bootstrap.pypa.io/get-pip.py | python3
- 安装xcode命令行工具
xcode-select --install
- 安装scrapy
pip install scrapy
- 安装成功
scrapy
Scrapy 2.2.0 - no active project
Usage:
scrapy <command> [options] [args]
Available commands:
bench Run quick benchmark test
commands
fetch Fetch a URL using the Scrapy downloader
genspider Generate new spider using pre-defined templates
runspider Run a self-contained spider (without creating a project)
settings Get settings values
shell Interactive scraping console
startproject Create new project
version Print Scrapy version
view Open URL in browser, as seen by Scrapy
[ more ] More commands available when run from project directory
Use "scrapy <command> -h" to see more info about a command