Fork me on github

macOS 安装工具 homebrew + gnuplot

默认电脑之前并没有安装开发工具之类的,分两步进行:安装 homebrew 和 安装 gnuplot

一、安装 homebrew

homebrew有点类似于Ubuntu的apt,软件安装服务类型。

1. 首先运行安装命令:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

正常情况下会开始安装东西,这个时间会持续挺久的,如果不能进行,出现如下报错:

 

 

说明hosts有问题,需要将 199.232.68.133 加入hosts中

1. ping一下 199.232.68.133 ,如果不能ping通应该是网络问题,如果ping通继续下一步;

2. 进入/etc文件夹

cd /etc

cp hosts hosts_backup

sudo vim hosts

3. 修改hosts,如果会用vim可以按图直接修改,不会的请继续看下去

 

 

 

 

输入i,进入编辑模式;

方向键移动光标到修改位置,添加host;

esc键,输入wq,回车;

继续执行: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 

2. 调试环境

这时候百分之九十的几率会遇到这个问题:

 

 

这时候最好的办法是,从github下载安装包【如果没有安装git的话,可以先安装xcode,这个反正也是必须的】

依次执行以下代码(取自这里,进行了精简https://blog.csdn.net/survivorsfyh/article/details/103960551)

git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
cd "$(brew --repo)" 
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" 
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
brew update

如果最后显示如下图,证明安装成功:

 

二、安装gnuplot

gnuplot是一个轻量化的实验数据制图工具,比Matlab轻量,afl-plot就是用的这个工具,这时候安装gnuplot就很容易了:

brew install gnuplot

安装成功,输入gnuplot,显示如下图:

 

 

 

简单使用,输入sin(x),得到如图:

 

 

 

大功告成!完结散花🥳🥳🥳

posted @ 2020-10-26 16:17  未配妥剑,已入江湖  阅读(852)  评论(0编辑  收藏  举报