64-bit WIN7 build Python development platform (PYTHON3++IPYTHON_NOTEBOOK+NUMPY+SCIPY+MATPLOTLIB+PYQT4)

Source: Internet
Author: User
Tags lapack intel mkl

Life are short, you need python!

------Bruce Eckel (ANSI C + + Comitee member)

PYTHON[1] is a hard-to-learn programming language, and I like it because it gives people a sense of accomplishment quickly, and a huge library of extensions can almost help you accomplish many seemingly difficult things at once. Python's tentacles have gone deep into all areas of learning, work, and even in the field of scientific computing, and many of the oldest Fortran libraries (such as lapack[2]) have been encapsulated as Python's extension libraries, continuing to exude vitality.

Python is open source, free of charge. Open source, often reminds me of cross-platform issues. Linux on the software to be ported to Windows above, to rely on cygwin[3], but its performance is not satisfactory, and later with Mingw[4], can compile 32-bit Lapack library, with Msys[5] became a mini Linux. But only 32 people still can not be satisfied, then have mingw-w64[6], even msys also lonely, made a msys2[7], finally perfect, estimated to cure a lot of people's obsessive-compulsive disorder, but its package management tool Pacman really let me headache.

64-bit has become the mainstream, Python's development platform is naturally best 64-bit. Simple Win64 on the Python is not a problem, the key is to support the expansion of the library, such as Numpy[8], scipy[9], the official only provides the Win32 installation package, want to use on the 64-bit Python, can only compile their own. This is not the worst case, in Python for quite a long time, these libraries are actually only python2 version, if you are still using Python2, that can install a python (x, y) [10], the latest version based on python2.7.6,700+ The MB installation package contains an extensive library that can be used in almost any other commercial software such as Matlab or Mathematica.

Back to the issue of compiling 64-bit extension library, NumPy need 64-bit Lapack library, this is not difficult, I use mingw-w64 can compile out, in fact, this work early someone did [11], can also be directly installed an Intel MKL[12], with the Intel compiler on it, [13] Someone has implemented Linux. These three ideas I have tried for a while, finally found that NumPy's documentation is too coarse, it is impossible to compile successfully. Just as I was about to give up, I discovered the work of Christoph Gohlke [14], the guy compiled many open-source scientific computing libraries for Python under Windows, and it was updated very quickly, almost the latest version. Have to believe the fact that there are 7 billion people in the world, unless you do the work is the forefront of the field, otherwise you encounter problems, most of them have been solved by others. So, take it, learn it, move on, move on to the forefront.

In a word, I have all the things I need, the following is the monotonous installation, configuration process.

    1. Python 3.4.1 x86_64: This is needless to say.
    2. NumPy, SciPy, matplotlib[15], ipython[16], pyqt4[17]: Download the 64-bit installation package directly from [14], as well as the dependencies of the package, run the installation, the program will automatically install into the Python directory.

Here the Ipython actually belong to the IDE, about the IDE, I tried ERIC5, Wing IDE, Eclipse+pydev, etc., but the favorite is Ipython and idle. When learning the basics of Python, using idle, Learning Scientific Computing Library NumPy, scipy, Matplotlib, IPython, especially IPython notebook is the choice. Idle and Ipython can be used directly after installation, the configuration of Ipython notebook is described below:

1. Make sure the Ipython works: Enter ipython on the command line to display the following prompt:

  

If you are prompted for a missing dependent library, download the installation at [14].

2. Installation Mathjax:mathjax can easily display mathematical symbols and formulas. By default Ipython notebook can use the online Mathjax, which is installed locally for ease of use in offline situations. Run the following command in Ipython

1 From IPython.external.mathjax import Install_mathjax 2 Install_mathjax ()

3. Build and modify the configuration file: Run Ipython profile create under the command line and generate the Profile_default directory under C:\Users\yourname\.ipython\, where Ipython_ notebook_config.py is the configuration file to be modified. Add the following content

1 c.notebookapp.enable_mathjax = True2'x:\\xxx'// Notebook Startup directory 3 ' inline '  // The resulting graphics are embedded in the notebook and can also be implemented in notebook via the%pylab inline command

4. Configure Matplotlib: This is available in the Configuration Guide section of its official documentation. My main concern is its ability to render latex, which requires the installation of texlive[18] or miktex[19], and ghostscript[20], and adds its bin directory to the system PATH environment variable. This will generate EPS pictures, of course, this need to add the following instructions in the program

1  as MPL 2 mpl.rcparams['text.usetex'// enable Tex3 mpl.rcparams ['text.latex.unicode']=true  // enable Unicode

Of course, this can also be done by modifying the. \PYTHON34\LIB\SITE-PACKAGES\MATPLOTLIB\MPL-DATA\MATPLOTLIBRC configuration file.

In the actual running process, it is possible to encounter the inability to export large EPS image files, accompanied by a temporary file in the protection of the error prompt, I am directly the user temporary file directory to the non-system disk directory to resolve. Setting User Environment variables

1 temp=X:\XX2//X is non-system disk

5. So far, we can run notebook Ipython notebook

Run an example on the official homepage of Matplotlib [21], add a command to the output EPS file, and run it perfectly as follows:

  

My notebook screen is small, only to intercept this part of the picture.

As you can see, the interface of Ipython notebook is very similar to that of Mathematica, and how big is the difference in functionality? I don't know, because I'm into Python's arms!

[1] Http://en.wikipedia.org/wiki/Python_ (programming_language) [2] http://www.netlib.org/lapack/[3]/http WWW.CYGWIN.COM/[4] http://www.mingw.org/[5] http://www.mingw.org/wiki/msys/[6] http://mingw-w64.sourceforge.net/[ 7] http://sourceforge.net/projects/msys2/[8] http://www.numpy.org/[9] http://www.scipy.org/[10] https:// CODE.GOOGLE.COM/P/PYTHONXY/[11] http://icl.cs.utk.edu/lapack-for-windows/lapack/[12] https://software.intel.com/ EN-US/FORUMS/INTEL-MATH-KERNEL-LIBRARY/[13] http://blog.csdn.net/tengh/article/details/7940933[14]/http WWW.LFD.UCI.EDU/~GOHLKE/PYTHONLIBS/[15] http://matplotlib.org/[16] http://ipython.org/[17]/http PYQT.SOURCEFORGE.NET/DOCS/PYQT4/[18] https://www.tug.org/texlive/[19] http://miktex.org/[20]/http WWW.GHOSTSCRIPT.COM/[21] Http://matplotlib.org/users/usetex.html#usetex-with-unicode

64-bit WIN7 build Python development platform (PYTHON3++IPYTHON_NOTEBOOK+NUMPY+SCIPY+MATPLOTLIB+PYQT4)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.