<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>lock file Archives - Creatronix</title>
	<atom:link href="https://creatronix.de/tag/lock-file/feed/" rel="self" type="application/rss+xml" />
	<link>https://creatronix.de/tag/lock-file/</link>
	<description>My adventures in code &#38; business</description>
	<lastBuildDate>Tue, 11 Nov 2025 09:36:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Python Pipfile and pipenv</title>
		<link>https://creatronix.de/python-pipfile-and-pipenv/</link>
		
		<dc:creator><![CDATA[Jörn]]></dc:creator>
		<pubDate>Mon, 30 Jul 2018 08:31:58 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[lock file]]></category>
		<category><![CDATA[pip]]></category>
		<category><![CDATA[pipenv]]></category>
		<category><![CDATA[pipfile]]></category>
		<category><![CDATA[pycharm]]></category>
		<guid isPermaLink="false">http://creatronix.de/?p=1827</guid>

					<description><![CDATA[<p>&#160; If You already read Python pip and virtualenv you are familiar with the way python handles requirements. but lo and behoild there is a new kid in town or actually two new kids on the block: Pipfile and Pipenv &#8211; both with with a capital &#8220;P&#8221;. If you are tired of creating and maintaining&#8230;</p>
<p>The post <a href="https://creatronix.de/python-pipfile-and-pipenv/">Python Pipfile and pipenv</a> appeared first on <a href="https://creatronix.de">Creatronix</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<p>If You already read <a href="https://creatronix.de/python-pip-and-virtualenv/">Python pip and virtualenv</a> you are familiar with the way python handles requirements. but lo and behoild there is a new kid in town or actually two new kids on the block: Pipfile and Pipenv &#8211; both with with a capital &#8220;P&#8221;.</p>
<p>If you are tired of creating and maintaining your virtual envrionments, requirements.txt and requirements_to_freeze.txts: Enter Pipenv!</p>
<h2>Prerequisites</h2>
<p>To install Pipenv you have to have</p>
<ul>
<li>Python 3.2 or greater installed and in your path. Check on your command line / shell:</li>
</ul>
<pre>$ python --version</pre>
<ul>
<li>pip installed</li>
</ul>
<pre>$ pip --version</pre>
<h2>Installation</h2>
<p>Now you can use pip to install Pipenv:</p>
<pre>$ pip install pipenv</pre>
<h2>Using Pipenv</h2>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-1844" src="https://creatronix.de/wp-content/uploads/2018/07/too_damn_high.jpg" alt="" width="420" height="316" srcset="https://creatronix.de/wp-content/uploads/2018/07/too_damn_high.jpg 420w, https://creatronix.de/wp-content/uploads/2018/07/too_damn_high-300x226.jpg 300w" sizes="(max-width: 420px) 100vw, 420px" /></p>
<pre>$ pipenv install flask</pre>
<p>If You run this command it will do four things:</p>
<ul>
<li>create a virtual environment</li>
<li>create a Pipfile</li>
<li>create a Pipfile.lock</li>
<li>install the flask package into the virtual environment</li>
</ul>
<h2>The Pipfile</h2>
<p>Pipfile is the replacement for the requirements.txt. It only contains the high level dependencies.</p>
<pre>[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
flask = "*"

[dev-packages]

[requires]
python_version = "3.6"</pre>
<h3>Versions</h3>
<p>Under the section packages you can specify minimal, maximal or exact versions of a dependency.  The syntax looks a bit odd when you are used to pip&#8217;s / requirements.txt cleaner syntax e.g. <code>responder==2.3.4</code> but hey: roll with the punches 🙂</p>
<pre>[packages]
responder = "==0.1.0"  # exactly 0.1.0
responder = "&gt;0.1.0"   # newer -&gt; 0.1.4 as I'm writing this
responder = "&lt;0.1.0"   # released before 0.1.0 -&gt; 0.0.10</pre>
<h2>Pipfile.lock</h2>
<p><img decoding="async" class="alignnone size-full wp-image-1842" src="https://creatronix.de/wp-content/uploads/2018/07/not_simply.jpg" alt="" width="568" height="335" srcset="https://creatronix.de/wp-content/uploads/2018/07/not_simply.jpg 568w, https://creatronix.de/wp-content/uploads/2018/07/not_simply-300x177.jpg 300w" sizes="(max-width: 568px) 100vw, 568px" /></p>
<p>In the lockfile you can see all sub-dependencies of the flask package</p>
<pre>{
    "_meta": {
        "hash": {
            "sha256": "8ec50e78e90ad609e540d41d1ed90f3fb880ffbdf6049b0a6b2f1a00158a3288"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.6"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "click": {
            "hashes": [
                "sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d",
                "sha256:f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b"
            ],
            "version": "==6.7"
        },
        "flask": {
            "hashes": [
                "sha256:2271c0070dbcb5275fad4a82e29f23ab92682dc45f9dfbc22c02ba9b9322ce48",
                "sha256:a080b744b7e345ccfcbc77954861cb05b3c63786e93f2b3875e0913d44b43f05"
            ],
            "index": "pypi",
            "version": "==1.0.2"
        },
        "itsdangerous": {
            "hashes": [
                "sha256:cbb3fcf8d3e33df861709ecaf89d9e6629cff0a217bc2848f1b41cd30d360519"
            ],
            "version": "==0.24"
        },
        "jinja2": {
            "hashes": [
                "sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd",
                "sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4"
            ],
            "version": "==2.10"
        },
        "markupsafe": {
            "hashes": [
                "sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665"
            ],
            "version": "==1.0"
        },
        "werkzeug": {
            "hashes": [
                "sha256:c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c",
                "sha256:d5da73735293558eb1651ee2fddc4d0dedcfa06538b8813a2e20011583c9e49b"
            ],
            "version": "==0.14.1"
        }
    },
    "develop": {}
}</pre>
<h2>Activate the virtual environment</h2>
<p><img decoding="async" class="alignnone size-full wp-image-1843" src="https://creatronix.de/wp-content/uploads/2018/07/only_one.jpg" alt="" width="500" height="348" srcset="https://creatronix.de/wp-content/uploads/2018/07/only_one.jpg 500w, https://creatronix.de/wp-content/uploads/2018/07/only_one-300x209.jpg 300w" sizes="(max-width: 500px) 100vw, 500px" /></p>
<pre>$ pipenv shell</pre>
<p>activates the virtual environment</p>
<h2>Installing additional packages</h2>
<p>Like any good dependency manager Pipenv lets You install requirements pretty easily:</p>
<pre>$ pipenv install Flask-Login</pre>
<h2>Migrating your old projects</h2>
<p>If you already have a requirements.txt in your project you can run pipenv install and pipenv will convert your requirements.txt to a PipFile / Pipfile.lock</p>
<pre>pipenv install
requirements.txt found, instead of Pipfile! Converting...
Warning: Your Pipfile now contains pinned versions, if your requirements.txt did.
We recommend updating your Pipfile to specify the "*" version, instead.
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Updated Pipfile.lock (9832bf)!
Installing dependencies from Pipfile.lock (9832bf)...
================================ 6/6 - 00:00:04
To activate this project's virtualenv, run pipenv shell.</pre>
<h2>Helpful tools</h2>
<pre>$ pipenv graph
Flask-Login==0.4.1
  - Flask [required: Any, installed: 1.0.2]
    - click [required: &gt;=5.1, installed: 6.7]
    - itsdangerous [required: &gt;=0.24, installed: 0.24]
    - Jinja2 [required: &gt;=2.10, installed: 2.10]
      - MarkupSafe [required: &gt;=0.23, installed: 1.0]
    - Werkzeug [required: &gt;=0.14, installed: 0.14.1</pre>
<p>Voila, a dependency graph!</p>
<pre>$ pipenv check</pre>
<p>let&#8217;s You check your dependencies for security vulnerabilities.</p>
<h2>IDE support</h2>
<p>If you are using PyCharm (which You should of course) it&#8217;s already there with the 2018.2 release:</p>
<p><img decoding="async" class="alignnone size-full wp-image-2076" src="https://creatronix.de/wp-content/uploads/2018/07/pycharm_pipenv.png" alt="" width="779" height="491" srcset="https://creatronix.de/wp-content/uploads/2018/07/pycharm_pipenv.png 779w, https://creatronix.de/wp-content/uploads/2018/07/pycharm_pipenv-300x189.png 300w, https://creatronix.de/wp-content/uploads/2018/07/pycharm_pipenv-768x484.png 768w" sizes="(max-width: 779px) 100vw, 779px" /></p>
<p>Have fun using Pipenv!</p>
<p>&nbsp;</p>
<p>The post <a href="https://creatronix.de/python-pipfile-and-pipenv/">Python Pipfile and pipenv</a> appeared first on <a href="https://creatronix.de">Creatronix</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
