In Python development in order to manage and debug the project. Some specific packages must be installed. It is said that the industry is called Yak shaving-to do a very cool very gorgeous Python project before you have to do some boring preparation work. This article describes the Setuptool. Installation of Pip, distribute, nose, virtualenv.
1,python2.x Bug
First a bug in Python 2.x will cause the package installation to fail, with a 2.7 example of the following changes:
C:\PYTHON27\LIB\MIMETYPES.PYC line249
2, after the above changes, the installation is simple.
Easyintaller
Easy_install is a very good Python tool. Easy to install with very many Python programs
Https://pypi.python.org/pypi/setuptools--Windows (Simplified) Download ez_setup.py to a path, cmd into the path under type command python ez_ setup.py is complete installation
Pip
Pip is a tool for installing and managing Python packages and is a replacement for Easy_install, making it easy to install, update, and uninstall Python packages using PIP.
The first step: Https://pypi.python.org/pypi/pip download. Execute Python setup.py install is complete
Step Two: Set the Windows environment variable, add C:\Python27\Scripts to path, restart the cmd form
Step three: Pip is used. such as the most important pip install ModelName
Other necessary modules
I. Code package build and publish Distribute
Distribute is the replacement of the Setuptools (the setuptools is no longer maintained later)
Install with PIP: Pip install Distribute
II. Test module nose
Nose is one of the most popular test libraries for python, and nose is actively looking for files whose names begin with "Test_" when executed.
As with the test module name, the name of the test function must also start with Test_. Typically, nose will only look for test files under the current working folder. Unless specified with the-w parameter.
When looking for a file, it searches for the folder at the beginning of the test. Files, modules, packages. In particular, nose will scan the entire package recursively to look for test tests. Assuming a test is found, the setup device executes and then performs a test function or class.
After the installation is complete, C:\PythonXX\Scripts will have a nosetests.exe file that can be tested by typing ' nosetests ' on the command line (it will proactively find the current folder including "Test"). A string of folders and files to test).
Therefore assume that the environment variable was not added before. Remember to add C:\PythonXX\Scripts to the environment variable so that you can refer to Nosetests.exe directly in other folders.
Installing Nose:pip install nose with PIP
III. Python Environmental Management virtualenv
Virtualenv is used to create a standalone Python environment where multiple python is independent from each other. Environmental isolation means that multiple Python environments can be deployed in parallel (side-by-side) on the same machine, each of which is independent of each other and has its own Python programs, libraries, and running programs.
In this way, you can provide multiple developers with separate development environments on a single machine. It is also possible to provide a non-impacting environment for multiple applications on the same server. It can:
A) Install the new kit without permission
b) Different package version numbers can be used for different applications
c) package upgrade does not affect other applications
install with PIP: Pip install virtualenv
Windows XP Python2.7 Package management tool installs-setuptool,pip, distribute, nose, virtualenv