因?qū)ython的爬蟲(chóng)技術(shù)比較感興趣,所以想搗鼓下。
網(wǎng)上瀏覽了下,發(fā)現(xiàn)scrapy爬蟲(chóng)框架用的挺多的,所以自己也安裝下,安裝后執(zhí)行scrapy時(shí),提示command not found。
環(huán)境說(shuō)明:
mac catalina 系統(tǒng)
python環(huán)境為3.7版本
pip3的版本:19.1.3
操作步驟:
1、pip3 install Scrapy (安裝成功,無(wú)報(bào)錯(cuò)日志信息)
2、執(zhí)行 scrapy ,返回提示信息 command not found
經(jīng)網(wǎng)上搜尋資料發(fā)現(xiàn),需要?jiǎng)?chuàng)建軟連接:
本機(jī)python3.7的安裝路徑為:/Library/Frameworks/Python.framework/Versions/3.7/bin/scrapy
解決方案為:
執(zhí)行:ln -s /Library/Frameworks/Python.framework/Versions/3.7/bin/scrapy /usr/local/bin/scrapy
上述命令執(zhí)行后在命令行輸入:scrapy,返回信息如下:
Scrapy 1.7.4 - no active project
Usage:
scrapy <command> [options] [args]
Available commands:
bench Run quick benchmark test
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

至此解決問(wèn)題。