折腾:
【未解决】Mac中启动PySpider
期间,需要去安装phantomjs
mac install phantomjs
直接去:
brew update && brew install phantomjs
不过速度太慢,去参考
【已解决】mac中给brew设置代理加速下载和更新
去加速:
export ALL_PROXY=socks5://127.0.0.1:51837
好像速度依旧不快?
可以了:
xxx@xxx ~ brew update && brew install phantomjs ^C% ✘ xxx@xxx ~ export ALL_PROXY=socks5://127.0.0.1:51837 xxx@xxx ~ brew update && brew install phantomjs ==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3_2.yosemite.bottle.tar.gz ######################################################################## 100.0% ==> Pouring portable-ruby-2.6.3_2.yosemite.bottle.tar.gz

搞了半天,感觉卡死了。
去中断都不行:

算了,重启终端试试
brew install phantomjs
结果:
xxx@xxx ~ brew install phantomjs Error: Another active Homebrew update process is already in progress. Please wait for it to finish or terminate it to continue. Error: No available formula with the name "phantomjs" Found a cask named "phantomjs" instead. Try brew cask install phantomjs
去杀掉进程:
✘ xxx@xxx ~ ps aux | grep brew xxx 66843 6.4 2.0 4532696 167516 ?? S 10:09上午 0:13.41 /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/current/bin/ruby -W0 --disable=gems,did_you_mean,rubyopt /usr/local/Homebrew/Library/Homebrew/brew.rb update-report xxx 28453 0.0 0.0 4267948 524 s014 R+ 10:12上午 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn brew xxx@xxx ~ kill -9 66843 xxx@xxx ~ ps aux | grep brew xxx 32027 0.0 0.0 4268056 748 s014 R+ 10:12上午 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn brew
重新试试
xxx@xxx ~ brew install phantomjs Updating Homebrew... ==> Auto-updated Homebrew! Updated 2 taps (homebrew/core and homebrew/cask). ==> Updated Formulae Updated 1 formula. ==> Updated Casks c0re100-qbittorrent genymotion linphone seadrive seafile-client Error: No available formula with the name "phantomjs" Found a cask named "phantomjs" instead. Try brew cask install phantomjs
没有。需要换个方式:
brew cask install phantomjs
就可以了:
✘ xxx@xxx ~ brew cask install phantomjs Updating Homebrew... ==> Caveats phantomjs has been officially discontinued upstream. It may stop working correctly (or at all) in recent versions of macOS. ==> Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip ==> Downloading from https://bbuseruploads.s3.amazonaws.com/fd96ed93-2b32-46a7-9d2b-ecbc0988516a/downloads/8543ae7d-9ac7-43d3-9052-537d63f16d66/phantomjs-2.1.1-ma ######################################################################## 100.0% ==> Verifying SHA-256 checksum for Cask 'phantomjs'. ==> Installing Cask phantomjs ==> Linking Binary 'phantomjs' to '/usr/local/bin/phantomjs'. 🍺 phantomjs was successfully installed!
安装后去看看版本:
xxx@xxx ~ phantomjs --version 2.1.1
即可。
【总结】
此处最终是:
brew cask install phantomjs
即可安装。
转载请注明:在路上 » 【已解决】Mac中安装phantomjs