下载OpenPLC Editor for macOS.zip文件后,使用tar -zvxf
命令解压,然后将"OpenPLC Editor"拖入到"应用程序"文件夹
右键点击"OpenPLC Editor",打开这个""文件,替换为以下内容
#!/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 python@3.9
#/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 python@3.9
# /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