Because Python language in the big data processing, and the direction of scientific computing, and Django and other web frameworks have been in the industry consensus for many years, so this article intends to build a Python learning and development environment. Because my notebook and lab host system environment is mainly windows, this article is intended to build a python development environment under the Windows environment.
The content of this article is divided into the following parts: 1. Find the right ide;2. Build django;3. Build numpy+matplotlib+scipy Environment
*************************************************************************************************************** ************
1. Find the right IDE
*************************************************************************************************************** ************
There are many blog posts that have been explored about the right IDE, and I will not repeat them here. If simply say is: Master with anything, novice with comfortable on the line.
Emacs+vim, Daniel installed x commonly used, I side dishes, slightly----> python with IDE, function use, beginner can----> want to develop things, visual ide,eclipse+pydev, cross-platform preferred, programmers like----> Wingide,pycharm the Horse of God, wait for it to be done after the python is ripe.
I chose the Eclipse+pydev here, the reason is very simple, the previous development of Java used Eclipse, the quick function of the same for Python programming, installation PyDev plug-in easy to use, Another set of environment can cross the platform (want to change MacBook later, so this as my first choice)
One, Eclipse installation
About the installation of Eclipse is very human, free download development package on the Internet, can be directly used. Note, however, that it is best to install the Java Development environment first, and now I have the JVM installed in the machine, so that eclipse is easy to use.
Ii. installation of the Python environment and Pydev
First install the Python development environment, the official website download Python2.7.8 installation files, "Next" crazy point can be, but in the configuration process, there is an "environment variable" option, this or configuration is better.
Note on the Python download page
For subsequent environmental operations, I choose the first installation package, with the [1] suffix of the X64 under the installation package.
{In addition, this article focuses on the recommended installation of Python immediately after the installation of "Pip (will come with Easy_install)", how convenient, used to know! Remember to add "c:/python27/scripts" Environment variables in path after installation}
Install Pydev, this is installed in eclipse with plug-ins, the steps are as follows:
Launch Eclipse, click Help->install New software ... In the popup dialog box, click the Add button. Name fill in: Pydev, location fill http://pydev.org/updates
Then, step by step, put it down. If the process of loading, error. Re-install it.
Third, configuration Pydev
After installing Pydev, you need to configure the Python interpreter.
In the Eclipse menu bar, click Windows->preferences.
In the dialog box, click Pydev->interpreter-python. Click the New button, select the path of the Python.exe, and open it to display a window with many check boxes. Click OK
If it is a Mac system, click the "Auto Config" button
Regular code testing can be done (note, because the code editing in order to facilitate the international format common, so in the editing, we need to pydev coding and project space encoding Do "UTF-8" modification, specifically can be configured in Eclipse, not repeat here)
Iv. Code Testing
Start Eclipse, create a new project, file->new->projects ... Select Pydev->pydevproject to enter the project name.
New PyDev package. You can write the code.
Enter the package name, enter Test1 here
Good, Python and pydev environment to build this success!
*************************************************************************************************************** ************
2. Build Django
*************************************************************************************************************** ************
About what is Django, you guys go to Baidu Encyclopedia, here briefly, Django is a web development framework, MVC thought, all kinds of messy things are more mature, with a lot of people blabla.
To build Django, my beginner's mind is to learn Python while using Django to do some practical things, exercise programming skills, master a technology while strengthening the idea of programming, and by the way the python can take care of the AI,ML learning, I would like to work as a qualified researcher (Matlab also to learn, but this is something)
In fact, Django's documentation is really too rich (online, I have a cursory look, indeed enough, and China's yard door seems to be very enthusiastic about Django)
Here to steal a lazy, hang a website, http://django-1-7-doc.coding.io/index.html, inside the first step, installation, tells the meticulous in place Django installation configuration process, in addition this is part of the Django1.7 document, thanks to the efforts of translators!
--------------------------------------------------------------------------------------------------------------- --
Django Quick Install guide
Before you can use Django, you need to install it first. We have a complete installation guide. It covers all the issues that may be encountered during the installation process. This guide will guide you through one of the simplest and most core installations for understanding what is mentioned in the documentation.
Install Python (of course we've already done it)
As a Python site framework, Django needs to use Python. It supports 2.7,3.2,3.3 or 3.4 versions of Python. All of these python contain a lightweight database called SQLite. Therefore, you do not need to create a database yourself now.
Get the latest version of Python from http://www.python.org/download/, or use the package management tool in your operating system to get it.
Using Django in Jython
If you use Jython (a python implemented on the Java platform), you will need to perform some additional steps. Refer to Running Django on Jython to learn more details.
You can verify that Python is installed by typing python in the terminal window. If the installation is complete, you will see a message similar to the following:
Python 3.3.3 (default, Nov 26 2013, 13:33:18)
[GCC 4.8.2] on Linux
Type "Help", "copyright", "credits" or "license" for more information.
>>>
Create a database
If you need a "big" database engine, such as Postgresql,mysql, or Oracle, this is a step that must be done. If you want to install these databases, see database installation information.
Remove old versions of Django
If you want to upgrade from an older version of Django, you first need to uninstall the old version before installing the new version of Django.
Installing Django
There are three simple ways to install Django:
- Install a Django installation package that is issued by your operating system. This is the quickest way to install a Django installation package for an operating system.
- Install the official release version. This is the best way for anyone who wants to install a stable version without mind running a slightly older version of Django.
- Install the latest development version. This is the best choice for those who want to try out the latest and greatest features without worrying about running new code.
Always refer to the documentation for the Django version you are using!
If you use one of the first two methods to install Django, be aware of the new section in the documentation that is indicated in the development version . This flag indicates that this feature can only be used in the development version and cannot be used in official releases.
Verifying the installation
In order to verify that Django was successfully installed in Python, enter pythonunder your terminal window. Then, at the python prompt, try importing Django:
>>> Import Django
>>> print (Django.get_version ())
1.7
You may have installed a different version of Django.
installation is complete!
Installation is complete! -Now you can learn the Getting Started tutorial.
--------------------------------------------------------------------------------------------------------------- --
This is the entire Django installation process and it looks so easy.
*************************************************************************************************************** ************
3. Build numpy+matplotlib+scipy Environment
*************************************************************************************************************** ************
Eh, as a section of the unknown in the CS industry, from the beginning of the direction of the run, fortunately, now finally set the goal of the future, the topic is far away ... Said back, this section discusses the construction of the scientific computing environment, you ask me why not use MATLAB, please go out to the left of Baidu Google "about Python and MATLAB to do scientific processing which strong?" "And so on such questions, and I did not say that Matlab ah?!
First, it must be stated that in the previous article "(a) installation of the initial environment" has elaborated a Python under Linux processing Artifact Anaconda, the environment has everything, just windows as the OS world of the benchmark, make some strange things or slightly weaker.
First, the configuration steps:
(First, the installation process, the specific download link in the corresponding text has a link, and in the end of the article will be specifically given a link)
First install Python, the installation process is very simple, direct download and click to run on the line. (stated above, no repetition)
Then install NumPy, Matplotlib, scipy respectively. Just click on the line to run. It is automatically retrieved to the Python installation path, as shown in the installation process diagram:
Do not want to wordy, crazy point "next" becomes. About matplotlib,scipy in the same vein.
But installation matplotlib is very annoying, will prompt missing "dateutil" and "pyparsing", so still have to install, but this don't worry, direct command under "Easy_install datautil", "Easy_install Pyparsing "command to enter individually.
-----------------------------------------------------------------
Note: In a blog post, this article has never encountered
This may be because the installation has ended, but when you run the Paint program, the following error occurs:
Hint says no module named six, Workaround: Copy the path such as: C:\Python27\Lib\site-packages\scipy\lib six.py six.pyc six.pyo three files to C:\Python27\ The Lib\site-packages directory.
-----------------------------------------------------------------
NumPy, Matplotlib, scipy have been successfully configured in Python under Windows.
When drawing, the Chinese characters appear garbled, the solution: in code Dynamic settings: Add code
#-*-Coding:utf-8-*-, and then use the code to set the font and so on.
Detailed process can refer to the original website: http://blog.chinaunix.net/uid-26611383-id-3521248.html.
Garbled after the correction is:
Done!
---to be continued supplementary dividing line---
Adam Ge
2015,01,24 22:55
(2) Setting up the Python environment on the windows 7 x64 side