-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequirement-files-in-python.html
149 lines (122 loc) · 7.59 KB
/
requirement-files-in-python.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!doctype html>
<html lang="en" itemscope itemtype="http://schema.org/Person">
<!-- <body background="https://images3.alphacoders.com/116/thumb-350-116875.jpg"> -->
<head>
<meta charset="utf-8">
<!-- Site Meta Data -->
<title>Requirement Files in Python</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="Snehal Karale">
<link rel="shortcut icon" href="">
<!-- schema.org -->
<meta itemprop="name" content="Snehal's Blog">
<meta itemprop="image" content="">
<meta itemprop="description" content="">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700' rel='stylesheet' type='text/css'>
<!-- Style Meta Data -->
<link rel="stylesheet" href="/theme/css/style.css" type="text/css" />
<link rel="stylesheet" href="/theme/css/pygments.css" type="text/css" />
<!-- Feed Meta Data -->
<!-- Twitter Feed -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="">
<meta name="twitter:image" content="">
<meta name="twitter:creator" content="">
<meta name="twitter:url" content="/requirement-files-in-python.html">
<meta name="twitter:title" content="Snehal's Blog ~ Requirement Files in Python">
<meta name="twitter:description" content="<p>When you are setting up an application on new system, you have to install bunch
of dependencies i.e. bunch of packages required by that application. So it is
difficult to find the dependencies or to remember the dependencies every time
before installation. So Solution is here :) And Requirement files ...</p>">
<!-- Facebook Meta Data -->
<meta property="og:title" content="Snehal's Blog ~ Requirement Files in Python" />
<meta property="og:description" content="<p>When you are setting up an application on new system, you have to install bunch
of dependencies i.e. bunch of packages required by that application. So it is
difficult to find the dependencies or to remember the dependencies every time
before installation. So Solution is here :) And Requirement files ...</p>" />
<meta property="og:image" content="" />
</head>
<body>
<!-- Sidebar -->
<aside>
<!-- <center><a href=""><img id="avatar" src=""></a></center> -->
<h1>Snehal's Blog</h1>
<br>
<nav class="nav">
<ul class="list-bare">
</ul>
</nav>
<p class="social">
<a href="https://www.facebook.com/snehal.karale.52" target="_blank" ><img src="/theme/images/icons/facebook.png"></a>
<a href="https://twitter.com/skarale25" target="_blank" ><img src="/theme/images/icons/twitter.png"></a>
<a href="https://in.linkedin.com/in/snehal-karale-09328251" target="_blank" ><img src="/theme/images/icons/linkedin.png"></a>
</p>
<h2>Categories</h2>
<ul class="navbar">
<li><a href="/category/experience-sharing.html">Experience Sharing</a></li>
<li class="active"><a href="/category/python.html">Python</a></li>
</ul>
</aside>
<!-- Content -->
<article>
<section id="content">
<article>
<h2 class="post_title post_detail"><a href="/requirement-files-in-python.html" rel="bookmark" title="Permalink to Requirement Files in Python">Requirement Files in Python</a></h2>
<div class="entry-content blog-post">
<p>When you are setting up an application on new system, you have to install bunch
of dependencies i.e. bunch of packages required by that application. So it is
difficult to find the dependencies or to remember the dependencies every time
before installation. So Solution is here :) And Requirement files comes in the
picture here. Python provides the way to freezing the required packages in single
file and run that file on every new system to install an application. Now you get
the idea, what this blog is about. So in this blog, I am going to talk about
requirement files in python. Let's start.......</p>
<p>Up till now you get the idea about what is requirement file, so we will go with some
technical details.Requirement files contain a list of packages to be install using pip
install.</p>
<div class="section" id="freezing-the-requirements">
<h2>Freezing the requirements</h2>
<p>How to create requirement.txt? To create requirement.txt use following command,</p>
<p>$ pip freeze > requirement.txt</p>
<p>The above command will freeze i.e. collect the packages and copied and save in requirement.txt</p>
<p>when you run</p>
<p>$ pip freeze</p>
<p>in your current development environment, it will gives you list of packages with versions. For Example-</p>
<p>Markdown==2.6.5</p>
<p>pelican==3.6.0</p>
<p>The idea behind requirement file is, making repeatable installations.</p>
<p>Once your requirement file is ready, you can install it on other system using following-</p>
<p>$ pip install -r requirement.txt</p>
<p>Requirement files create a environment required to run your application. This is what I learnt and implement in second week.</p>
</div>
</div>
<div class="post_list">
<span>By </span>
<a href="/author/snehal-karale.html">@Snehal Karale</a>
<span> in </span>
<span class="post_category"><a href="/category/python.html" rel="bookmark" title="Permalink to Python">[ Python ]</a></span>
<span class="post_date">Fri 22 January 2016</span>
<div><span>Tags : </span>
</div>
<div class="entry-social">
<span class="twitter"><a target="_blank" rel="nofollow" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=700');return false;" title="Twitter" href="https://twitter.com/share?url=/requirement-files-in-python.html&text=Requirement Files in Python&via="><img src="/theme/images/icons/twitter-s.png"></a></span>
<span class="gplus"><a target="_blank" title="Google +" href="https://plus.google.com/share?url=/requirement-files-in-python.html&hl=fr" rel="nofollow" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=450,width=650');return false;"><img src="/theme/images/icons/google-s.png"></a></span>
<span class="facebook"><a target="_blank" title="Facebook" rel="nofollow" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=700');return false;" href="https://www.facebook.com/sharer.php?u=/requirement-files-in-python.html&t=Requirement Files in Python"><img src="/theme/images/icons/facebook-s.png"></a></span>
<a target="_blank" title="Linkedin" href="https://www.linkedin.com/shareArticle?mini=true&url=/requirement-files-in-python.html&title=Requirement Files in Python" rel="nofollow" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=450,width=650');return false;"><img src="/theme/images/icons/linkedin-s.png"></a>
<span class="mail"><a href="mailto:?subject=Requirement Files in Python&body=Viens découvrir un article à propos de [Requirement Files in Python] sur le site de Snehal Karale. /requirement-files-in-python.html" title="Share by Email" target="_blank"><img src="/theme/images/icons/mail-s.png"></a></span>
</div>
</div>
</article>
</section>
</article>
<!-- Footer -->
<footer>
<p>
Blog powered by <a href="http://getpelican.com/">Pelican</a>,
which takes great advantage of <a href="http://python.org">Python</a>.
Theme <a href="https://github.com/parbhat/pelican-blue">Pelican-Blue</a> by <a href="https://parbhatpuri.com/">@parbhat</a>.
</p>
</footer>
</body>
</html>