mac 安裝scrapy踏坑

因?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

image.png

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

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容