python@MAC
Posted gaoyazhao
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python@MAC相关的知识,希望对你有一定的参考价值。
一、MAC install APPs
1. apple Store
2. web search
3. brew
install brew: curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1
use brew example: brew install git, brew uninstall git,
二、Python
1. www.python.org to get python.
python3.5 is suggested: 1) python3+pyqt5 works for MAC&Windows, or we have too many troubles; 2) python3.6 is not supported by pyinstaller3.2.1 yet.
2. install package for python: 'sudo easy_install <app name>'
3. www.sourceforge.net
4. pipy.python.org
5. pyqt5:
(1) install Xcode from apple store(optional)
(2) install QT by brew install qt5(optional, suggested since QT5 help could be seen, and a lot of QT5)
(3) install pyqt5 automatically: pip3 install PyQt5(suggested) or https://pypi.python.org/pypi/pyqt5-installer/5.7.0
if manually, SIP should be installed first and next is pyqt5.
http://sourceforge.net/projects/pyqt/files/sip/sip-4.18.1/sip-4.18.1.tar.gz
https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.7/PyQt5_gpl-5.7.tar.gz
note: installed packages in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
6. pyqt4 (NOT usable):
NOT possible since: fatal error:'QTKit/QTDataReference.h' file not found
(1) install Xcode from apple store
(2) install QT4.8.6:
guide: https://www.zhihu.com/question/38792561
download: http://download.qt.io/archive/qt/4.8/4.8.6/
install: http://doc.qt.io/qt-4.8/install-mac.html
(3) install pyQT4.12:
download: https://sourceforge.net/projects/pyqt/?source=typ_redirect
7. use pyinstaller to get a single app:
brew install pyinstaller or pip3 install pyinstaller
pyinstaller -F --noconsole main.py
以上是关于python@MAC的主要内容,如果未能解决你的问题,请参考以下文章