Why virtualenv, Fabric and Pip are the three great artifacts of pythoneer?

Source: Internet
Author: User
Tags virtual environment virtualenv

Reply content:

These three are very handy for Python project deployment.
1. Virtualenv is used to create a virtual Python environment, a project-specific Python environment. It is very useful to use virtualenv to keep a clean environment.
2. Pip is used to solve the project dependency problem. Write all dependent third-party libraries of the project in one Requirements.txt and batch install with PIP. Typically used in conjunction with VIRTUALENV, all packages are installed in the VIRTUALENV environment.
3. Fabric is very convenient for automating remote deployment projects. You can perform a series of shell commands, programs, and so on locally and remotely, as needed. For example, update the code from the code base, perform data migration scripts, restart the service process, and complete the automated deployment. The module dependency mechanism provided by Easy_install and Setuptools is equally useful, and the individual does not like Pip very much.
Virtualenv Similar is the more powerful zc.buildout, support through the configuration file generation environment, the version of Python is no problem, through the buildout plugin, automatically download Apache and compile support Python is not a problem. On function, Zc.buildout stronger. Ansible ... the word "artifact" is the "pseudo-word flag" of the programming world. I disagree, Buildout is the real good thing compared to virtualenv and Pip, whether it's the cleanliness of the virtual Python environment, the ease of use, the customizable/manipulative degree of the installation package, or support for batch deployments is far beyond the former. Can say Virtualenv + pip also stay in the manual era, and Buildout has entered the mechanical age.

As for fabric, it's a good tool. Simply a fabfile can be used to implement batch deployment and management of code, and you can choose not to use its fab command and its own API for deep development, the only weakness is the dependency on ssh slightly heavier.

Another good tool supervisor is recommended. Out of where, I disagree I recommend the following three artifact SQLAlchemy, twisted, gevent just this semester learning to use Python classes. Fabric doesn't work, Pip is handy for some Python package installation management process, VIRTUALENV provides a clean virtual environment.
Pip and virtualenv are really good, for me to learn the course, these two must be used, otherwise involved in the reference Python package and related to switch the environment of those jobs are basically no way to do. But I don't know if they're artifacts.
Thanks for the upstairs answer, I've recently tried these Python tools mentioned above. This semester contact with Python, feel really good things, personal feel more useful than Java has not used fabric, first talk about Virtualenv and Pip

The PIP is similar to Maven in Java (Management only, no build feature), can reference other projects directly, and does not have to be included in the project with someone else's code. Requirements.txt is also a very important thing, just need Pip Install-r requirements.txt just fine.

Virtualenv can create a standalone Python environment, with separate applications using separate environments. This way, when you deploy the app, you only need to create a new virtualenv, and then Pip Install-r requirements.txt, just delete the virtuenv when you undo the app. Avoids the installation of a large heap in the global environment, management difficulties, and possible conflicts. (Of course, the virtual machine, the container can also achieve this effect, but the cost is too high)


2016-02-17 Update

Fabric is to automate and unify some of the frequently performed operations, scripts. Reduces the probability of human error.
Of course, it seems that ansible is more popular now. Using only virtualenv, this can simulate your own library environment for each Python application.
Ideal for batch deployments, no need to consider conflicts with other application environments.
  • Related Article

    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.