M1安装OpenPLC Editor

下载OpenPLC Editor for macOS.zip文件后,使用tar -zvxf命令解压,然后将"OpenPLC Editor"拖入到"应用程序"文件夹

M1安装OpenPLC Editor_第1张图片

右键点击"OpenPLC Editor",打开这个""文件,替换为以下内容

M1安装OpenPLC Editor_第2张图片
M1安装OpenPLC Editor_第3张图片

#!/bin/bash
# echo "Installing Xcode Command Line Tools..."
# xcode-select --install
# echo "Installing Brew..."
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

CFBAK="$CFLAGS"
CXFBAK="$CXXFLAGS"
export CFLAGS=-I$(brew --prefix)/include
export CXXFLAGS=-I$(brew --prefix)/include

if test -f "/opt/homebrew/bin/brew"; then
    #/opt/homebrew/bin/brew install [email protected]
    #/opt/homebrew/bin/python3.9 -m pip install --upgrade pip
    #python3 -m pip install wxPython==4.1.1 lxml==4.6.2 future matplotlib zeroconf pyserial pypubsub pyro5
    rm "/Applications/OpenPLC Editor.app/Contents/MacOS/not-installed"
    clear
    echo "============================"
    echo "All dependencies were successfully installed. You can now close this terminal window"
    echo "============================"
    exit
elif test -f "/usr/local/bin/brew"; then
    # /usr/local/bin/brew install [email protected]
    # /usr/local/bin/python3.9 -m pip install --upgrade pip
    # /usr/local/bin/python3.9 -m pip install wxPython==4.1.1 lxml==4.6.2 future matplotlib zeroconf pyserial pypubsub pyro5
    rm "/Applications/OpenPLC Editor.app/Contents/MacOS/not-installed"
    clear
    echo "============================"
    echo "All dependencies were successfully installed. You can now close this terminal window"
    echo "============================"
    exit
else
    echo "============================"
    echo "There was an error installing Brew, Python or one of its dependencies. Please check the logs"
    echo "============================"
    exit
fi

export CFLAGS="$CFBAK"
export CXXFLAGS="$CXFBAK"

然后自己手动在终端执行一个命令,安装依赖包

python3 -m pip install wxPython==4.1.1 lxml==4.6.2 future matplotlib zeroconf pyserial pypubsub pyro5

记得保存,然后双击打开,点击"是",即可运行。

M1安装OpenPLC Editor_第4张图片

你可能感兴趣的:(OpenPLC,Editor,M1,macOS)