我需要从我的电子应用程序运行python脚本。我必须在安装后设置python虚拟env。类似于以下内容(但希望平台不可知)。
cd /Applications/z.app/Contents/Resources/app.asar.unpacked brew reinstall python brew upgrade python pip3 install --upgrade pip pip3 install virtualenv python3 -m venv env source env/bin/activate pip install -r requirements.txt
第一步:
py2app 电子应用程序旁边 这样做有助于 https://github.com/stuarteberg/helloworld
py2app
https://github.com/stuarteberg/helloworld
第二步:
ImportError:没有名为PyQt4.QtGui的模块
conda install pyqt=4
2(b)(可选)
以上回购在pyqt4中,如果需要pyqt5:
pyqt5 在Mac上首次安装 macports ( https://guide.macports.org/#installing.macports ),然后做
pyqt5
macports
unset PYTHONPATH brew install sip --with-python3 brew install pyqt --with-python3