2016年9月17日 星期六

Selecting Python Distribution for Windows Platform

A Python distribution sets up CPython interpreter, popular/powerful packages and IDEs all at once, and saves lots of efforts. For a reference list of Python distributions, please refer to Alternative Python Implementations, which is a useful starting point.
Python開發環境能一次安裝及設定完成許多項目,包括CPython直譯器、許多通用又強大的套件及整合開發環境(IDE),能為開發人員省下許多力氣,並能立即開始使用。欲參考Python開發環境之清單,請參考Alternative Python Implementations,此為一有用的起點。

I am an engineer and my work platform is Windows 10 64-bit version, so I focus on free Python distribution and scientific computing for Windows platform. Anaconda, WinPython, Python(x,y)Canopy were compared, and features are summarized as the following table:
我是一位工程師,而我的工作電腦使用Windows 10 64位元作業系統,所以我所選擇的Python開發環境將傾向於免費、強調科學計算及於Windows作業系統上運作。以下比較AnacondaWinPythonPython(x,y)Canopy,並將各項特點整理如下表所示:
PYTHON DISTRIBUTION2016/Sep/01
AnacondaWinPythonPython(x,y)Canopy
python 2/3bothboth22
32/64 bitbothboth32both
licencefreefreefreefree for academic use,
or use Canopy Express (free version)
portablenoyesnono
package
    Numbayesyesnoyes
    Cythonyesyesyesyes
    Numexpryesyesyesyes
Numpy-MKLyesyesyesyes
linuxyesnonoyes
opencvnonoyesyes
note: ActivePython community edition is free for non-production use only.
註: ActivePython社群版僅於非生產用途才可免費使用。

Python is a high-level scripting language, its syntax is simple, it is suitable for rapid prototyping, and it glues together tools. However, its speed is not as fast as C programming language. Therefore the selected Python distribution should integrate Numpy-MKL and performance-enhancing packages including Cython, Numba, Numexpr. Fortunately this is satisfied for Anaconda, WinPython, and Canopy, except that Numba is not integrated in Python(x,y). Besides, considering Python 2/3 support and 32/64 bit support, Python(x,y) is dropped out.
Python為高階腳本語言,特色為語法簡單、適合用於快速原型設計及與其他程式語言進行整合串接。然而其運行速度比不上C語言, 所以我所選擇的Python開發環境將傾向於整合Numpy-MKL及增強運行效能之套件,如CythonNumbaNumexpr。Anaconda、WinPython、Canopy均符合上述需求,而Python(x,y)並未整合Numba。另考慮Python 2/3及32/64位元之支援,故排除Python(x,y)。

Considering licence issue, Enthought Canopy is dropped out.
考慮授權條款之因素,故排除Enthought Canopy。

Users in the office may not have the authentication to install a software, and a portable Python distribution is ideal. Hence WinPython is selected.
於辦公室作業之開發人員可能沒有安裝軟體之權限,此時免安裝的Python開發環境較為理想。所以我選擇WinPython。

To compile a Cython file on Windows platform, Microsoft Visual C++ Compiler is one of the option. However, every version of Microsoft Visual C++ Compiler is really huge and really fat except Microsoft Visual C++ Compiler for Python 2.7. Using it is a little tricky, please follow the instruction from Using Microsoft Visual C++ Compiler for Python (only for Python 2.7.x). It works for CPython 2.6, 2.7, 3.0, 3.1, and 3.2. Hence WinPython 2.7 is selected. However, the support for WinPython 2.7 was ended in 2015.
於Windows作業系統編譯Cython檔案時,也可使用Microsoft Visual C++編譯器。 然而每個版本的Microsoft Visual C++編譯器所占用的檔案空間均相當龐大,唯一的例外為Microsoft Visual C++ Compiler for Python 2.7。其在使用上需稍加注意,相關請參考Using Microsoft Visual C++ Compiler for Python (only for Python 2.7.x)。此編譯器可用於CPython 2.6、2.7、3.0、3.1及3.2,所以我選擇WinPython 2.7版本。然而WinPython 2.7版本已於2015年結束支援

沒有留言:

張貼留言