<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Tips - Tag - Vindrin</title><link>https://vindrin.top/tags/tips/</link><description>Tips - Tag - Vindrin</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>vindrin@outlook.com (Vindrin)</managingEditor><webMaster>vindrin@outlook.com (Vindrin)</webMaster><lastBuildDate>Tue, 03 Feb 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://vindrin.top/tags/tips/" rel="self" type="application/rss+xml"/><item><title>Python Virtual Environments Explained</title><link>https://vindrin.top/posts/python-venv-guide/</link><pubDate>Tue, 03 Feb 2026 00:00:00 +0000</pubDate><author>vindrin@outlook.com (Vindrin)</author><guid>https://vindrin.top/posts/python-venv-guide/</guid><description><![CDATA[<h1 id="python-virtual-environments-explained">Python Virtual Environments Explained</h1>
<p>If you&rsquo;ve ever broken a project by upgrading a package globally, you need venvs.</p>
<h2 id="what-is-a-venv">What is a venv?</h2>
<p>A virtual environment is an isolated Python installation — it has its own <code>pip</code> and packages, completely separate from your system Python.</p>
<h2 id="creating-one">Creating one</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">python -m venv .venv
</span></span><span class="line"><span class="cl"><span class="nb">source</span> .venv/bin/activate    <span class="c1"># Linux/macOS</span>
</span></span><span class="line"><span class="cl">.venv<span class="se">\S</span>cripts<span class="se">\a</span>ctivate       <span class="c1"># Windows</span></span></span></code></pre></div></div>
<h2 id="installing-packages">Installing packages</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pip install requests numpy pandas
</span></span><span class="line"><span class="cl">pip freeze &gt; requirements.txt</span></span></code></pre></div></div>
<h2 id="restoring-later">Restoring later</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">python -m venv .venv
</span></span><span class="line"><span class="cl">pip install -r requirements.txt</span></span></code></pre></div></div>
<h2 id="using-with-conda">Using with conda</h2>
<p>If you use conda, each <code>conda create -n myenv python=3.11</code> works the same way — isolated by default.</p>]]></description></item></channel></rss>