<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Python Developer Tooling Handbook – Virtual Environments</title>
    <link>https://pydevtools.com/handbook/topics/virtual-environments/</link>
    <description>pyenv, venv, virtualenv, isolation, and why you should never use system Python.</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Tue, 14 Apr 2026 10:48:30 -0400</lastBuildDate>
    
	  <atom:link href="https://pydevtools.com/handbook/topics/virtual-environments/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>direnv: Per-Directory Environment Variables for Python</title>
      <link>https://pydevtools.com/handbook/reference/direnv/</link>
      <pubDate>Thu, 30 Apr 2026 07:12:25 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/reference/direnv/</guid>
      <description>&lt;p&gt;direnv is a shell extension that loads and unloads environment variables based on the current working directory. It reads a per-directory &lt;code&gt;.envrc&lt;/code&gt; file when entering a folder and reverts the environment when leaving. Although direnv is language-agnostic, it is widely used in Python projects to activate &lt;a href=&#34;https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment/&#34;&gt;virtual environments&lt;/a&gt; and export project-specific settings without polluting the global shell.&lt;/p&gt;
&lt;h2&gt;Key Features&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;key-features&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#key-features&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Loads variables from &lt;code&gt;.envrc&lt;/code&gt; on &lt;code&gt;cd&lt;/code&gt; into a directory and unloads them on &lt;code&gt;cd&lt;/code&gt; out&lt;/li&gt;
&lt;li&gt;Provides a stdlib of layout helpers, including &lt;code&gt;layout python&lt;/code&gt;, &lt;code&gt;layout python3&lt;/code&gt;, &lt;code&gt;layout pyenv&lt;/code&gt;, and &lt;code&gt;layout pipenv&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Supports bash, zsh, fish, tcsh, elvish, and PowerShell&lt;/li&gt;
&lt;li&gt;Requires explicit per-directory authorization with &lt;code&gt;direnv allow&lt;/code&gt; before any new &lt;code&gt;.envrc&lt;/code&gt; runs&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Installation&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;installation&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#installation&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;direnv is distributed through most package managers:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Do I need a project to use uv?</title>
      <link>https://pydevtools.com/handbook/explanation/do-i-need-a-project-to-use-uv/</link>
      <pubDate>Tue, 28 Apr 2026 21:54:51 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/explanation/do-i-need-a-project-to-use-uv/</guid>
      <description>&lt;p&gt;If your Python life is a folder full of short scripts that glue APIs together and rename files, &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt;&amp;rsquo;s first move can look like overkill: &lt;code&gt;uv init&lt;/code&gt;, then a &lt;code&gt;pyproject.toml&lt;/code&gt;. uv works fine for scripts, but it assumes a different mental model from the &lt;a href=&#34;https://pydevtools.com/handbook/reference/pip/&#34;&gt;&lt;code&gt;pip install&lt;/code&gt;&lt;/a&gt; habit most script authors carry, and forcing the old habit onto uv is where people get stuck.&lt;/p&gt;
&lt;p&gt;The short answer: no, you don&amp;rsquo;t need a project. You have four options, and the right one depends on what the script is.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How do pyenv and uv compare for Python interpreter management?</title>
      <link>https://pydevtools.com/handbook/explanation/how-do-pyenv-and-uv-compare-for-python-interpreter-management/</link>
      <pubDate>Tue, 07 Apr 2026 14:40:41 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/explanation/how-do-pyenv-and-uv-compare-for-python-interpreter-management/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://pydevtools.com/handbook/reference/pyenv/&#34;&gt;pyenv&lt;/a&gt; manages Python versions and gets out of the way; &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt; manages Python versions as part of controlling your entire workflow. That difference in scope shapes every other trade-off between the two tools.&lt;/p&gt;
&lt;h2&gt;Design Philosophy&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;design-philosophy&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#design-philosophy&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;h3&gt;pyenv&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;pyenv&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#pyenv&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;pyenv embodies the Unix principle of &amp;ldquo;do one thing well.&amp;rdquo; Its sole purpose is managing Python interpreter installations and version switching. This focused approach means pyenv integrates seamlessly with existing workflows; after selecting a Python version, developers use familiar tools like &lt;a href=&#34;https://pydevtools.com/handbook/reference/pip/&#34;&gt;pip&lt;/a&gt; and &lt;a href=&#34;https://pydevtools.com/handbook/reference/venv/&#34;&gt;venv&lt;/a&gt; for package management and virtual environments.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to configure Claude Code to use virtual environments</title>
      <link>https://pydevtools.com/handbook/how-to/how-to-configure-claude-code-to-use-virtual-environments/</link>
      <pubDate>Wed, 13 May 2026 06:43:22 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/how-to/how-to-configure-claude-code-to-use-virtual-environments/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://code.claude.com/&#34;target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Claude Code&lt;/a&gt; starts a fresh shell for every Bash tool call, so &lt;code&gt;source .venv/bin/activate&lt;/code&gt; in one command has no effect on the next. Without configuration, Claude reaches for system Python and installs packages outside the project&amp;rsquo;s &lt;a href=&#34;https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment/&#34;&gt;virtual environment&lt;/a&gt;. Four configuration patterns work around the stateless-shell limitation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;uv run&lt;/code&gt; for projects on &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt;, which sidesteps activation entirely&lt;/li&gt;
&lt;li&gt;A CLAUDE.md instruction that tells Claude to call the venv&amp;rsquo;s interpreter directly&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;.claude/settings.json&lt;/code&gt; &lt;code&gt;env&lt;/code&gt; block that pre-sets &lt;code&gt;VIRTUAL_ENV&lt;/code&gt; and &lt;code&gt;PATH&lt;/code&gt; for every session&lt;/li&gt;
&lt;li&gt;A PreToolUse hook that blocks bare &lt;code&gt;python&lt;/code&gt; and &lt;code&gt;pip&lt;/code&gt; so the rules are enforced, not just suggested&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Trace why &lt;code&gt;source activate&lt;/code&gt; doesn&amp;rsquo;t persist&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;trace-why-source-activate-doesnt-persist&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#trace-why-source-activate-doesnt-persist&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Each Bash tool call Claude Code runs spawns a separate shell process. Environment changes made by &lt;code&gt;source .venv/bin/activate&lt;/code&gt; (it sets &lt;code&gt;VIRTUAL_ENV&lt;/code&gt; and prepends &lt;code&gt;.venv/bin&lt;/code&gt; to &lt;code&gt;PATH&lt;/code&gt;) live only inside that shell. When the next tool call starts a new shell, those variables are gone.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to create and use a Python virtual environment with venv</title>
      <link>https://pydevtools.com/handbook/how-to/how-to-create-and-use-a-python-virtual-environment-with-venv/</link>
      <pubDate>Wed, 13 May 2026 06:43:22 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/how-to/how-to-create-and-use-a-python-virtual-environment-with-venv/</guid>
      <description>&lt;p&gt;A README says &amp;ldquo;create a virtual environment&amp;rdquo; before it tells you what that means. Use Python&amp;rsquo;s built-in &lt;a href=&#34;https://pydevtools.com/handbook/reference/venv/&#34;&gt;&lt;code&gt;venv&lt;/code&gt;&lt;/a&gt; module to create one, activate it, and install packages into the right place. For the concepts, see &lt;a href=&#34;https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment/&#34;&gt;What is a virtual environment?&lt;/a&gt;. For a new project from scratch, &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt; handles all of this for you.&lt;/p&gt;
&lt;h2&gt;Create the environment&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;create-the-environment&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#create-the-environment&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Run this from your project directory:&lt;/p&gt;






&lt;div class=&#34;hextra-scrollbar hx:overflow-x-auto hx:overflow-y-hidden hx:overscroll-x-contain&#34;&gt;
  &lt;div class=&#34;hx:mt-4 hx:flex hx:w-max hx:min-w-full hx:border-b hx:border-gray-200 hx:pb-px hx:dark:border-neutral-800&#34; role=&#34;tablist&#34;&gt;&lt;button class=&#34;hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset&#34; id=&#34;tabs-tab-tabs-03-0&#34; role=&#34;tab&#34; type=&#34;button&#34; aria-controls=&#34;tabs-panel-tabs-03-0&#34; aria-selected=&#34;true&#34; tabindex=&#34;0&#34; data-state=&#34;selected&#34;&gt;&lt;span class=&#34;hx:inline-flex hx:items-center hx:gap-1.5&#34;&gt;&lt;span&gt;macOS/Linux&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;button class=&#34;hextra-tabs-toggle hx:cursor-pointer hx:data-[state=selected]:border-primary-500 hx:data-[state=selected]:text-primary-600 hx:data-[state=selected]:dark:border-primary-500 hx:data-[state=selected]:dark:text-primary-600 hx:mr-2 hx:rounded-t hx:p-2 hx:font-medium hx:leading-5 hx:transition-colors hx:-mb-0.5 hx:select-none hx:border-b-2 hx:border-transparent hx:text-gray-600 hx:hover:border-gray-200 hx:hover:text-black hx:dark:text-gray-200 hx:dark:hover:border-neutral-800 hx:dark:hover:text-white hx:hextra-focus-visible-inset&#34; id=&#34;tabs-tab-tabs-03-1&#34; role=&#34;tab&#34; type=&#34;button&#34; aria-controls=&#34;tabs-panel-tabs-03-1&#34; aria-selected=&#34;false&#34; tabindex=&#34;-1&#34;&gt;&lt;span class=&#34;hx:inline-flex hx:items-center hx:gap-1.5&#34;&gt;&lt;span&gt;Windows&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;div class=&#34;hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block&#34; id=&#34;tabs-panel-tabs-03-0&#34; role=&#34;tabpanel&#34; aria-labelledby=&#34;tabs-tab-tabs-03-0&#34; aria-hidden=&#34;false&#34; tabindex=&#34;0&#34; data-state=&#34;selected&#34;&gt;&lt;div class=&#34;hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code&#34;&gt;

&lt;div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;python3 -m venv .venv&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&#34;hextra-code-copy-btn-container  hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0&#34;&gt;
  &lt;button
    class=&#34;hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50&#34;
    title=&#34;Copy code&#34;
    aria-label=&#34;Copy code&#34;
    data-copied-label=&#34;Copied!&#34;
  &gt;
    &lt;div class=&#34;hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
&lt;div class=&#34;hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
  &lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class=&#34;hextra-tabs-panel hx:rounded-sm hx:pt-6 hx:hidden hx:data-[state=selected]:block&#34; id=&#34;tabs-panel-tabs-03-1&#34; role=&#34;tabpanel&#34; aria-labelledby=&#34;tabs-tab-tabs-03-1&#34; aria-hidden=&#34;true&#34;&gt;&lt;div class=&#34;hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code&#34;&gt;

&lt;div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;py&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;-m&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;venv&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;venv&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&#34;hextra-code-copy-btn-container  hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0&#34;&gt;
  &lt;button
    class=&#34;hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50&#34;
    title=&#34;Copy code&#34;
    aria-label=&#34;Copy code&#34;
    data-copied-label=&#34;Copied!&#34;
  &gt;
    &lt;div class=&#34;hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
&lt;div class=&#34;hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
  &lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If Windows does not recognize &lt;code&gt;py&lt;/code&gt;, use &lt;code&gt;python -m venv .venv&lt;/code&gt; instead.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to customize uv&#39;s virtual environment location</title>
      <link>https://pydevtools.com/handbook/how-to/how-to-customize-uvs-virtual-environment-location/</link>
      <pubDate>Wed, 13 May 2026 06:43:22 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/how-to/how-to-customize-uvs-virtual-environment-location/</guid>
      <description>&lt;p&gt;When working with uv projects, the virtual environment is automatically created in a folder called &lt;code&gt;.venv&lt;/code&gt; in your project directory.&lt;/p&gt;
&lt;div class=&#34;hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code&#34;&gt;

&lt;div&gt;&lt;pre&gt;&lt;code&gt;your-project/
├── pyproject.toml
├── .venv/          # Virtual environment location
└── src/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;hextra-code-copy-btn-container  hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0&#34;&gt;
  &lt;button
    class=&#34;hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50&#34;
    title=&#34;Copy code&#34;
    aria-label=&#34;Copy code&#34;
    data-copied-label=&#34;Copied!&#34;
  &gt;
    &lt;div class=&#34;hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
&lt;div class=&#34;hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
  &lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can override this default with a flag or a environmental variable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to fix the &#34;externally-managed-environment&#34; error</title>
      <link>https://pydevtools.com/handbook/how-to/how-to-fix-the-externally-managed-environment-error/</link>
      <pubDate>Wed, 13 May 2026 06:43:22 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/how-to/how-to-fix-the-externally-managed-environment-error/</guid>
      <description>&lt;p&gt;Running &lt;code&gt;pip install&lt;/code&gt; on a system Python protected by &lt;a href=&#34;https://pydevtools.com/handbook/explanation/what-is-pep-668/&#34;&gt;PEP 668&lt;/a&gt; produces this error:&lt;/p&gt;
&lt;div class=&#34;hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code&#34;&gt;

&lt;div&gt;&lt;pre&gt;&lt;code&gt;error: externally-managed-environment

× This environment is externally managed&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;hextra-code-copy-btn-container  hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0&#34;&gt;
  &lt;button
    class=&#34;hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50&#34;
    title=&#34;Copy code&#34;
    aria-label=&#34;Copy code&#34;
    data-copied-label=&#34;Copied!&#34;
  &gt;
    &lt;div class=&#34;hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
&lt;div class=&#34;hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
  &lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The fix depends on what was being installed.&lt;/p&gt;
&lt;h2&gt;Installing project dependencies&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;installing-project-dependencies&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#installing-project-dependencies&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Use &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt; to create a project with its own &lt;a href=&#34;https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment/&#34;&gt;virtual environment&lt;/a&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to require a virtualenv when installing packages with pip?</title>
      <link>https://pydevtools.com/handbook/how-to/how-to-require-a-virtual-for-installing-packages/</link>
      <pubDate>Wed, 13 May 2026 06:43:22 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/how-to/how-to-require-a-virtual-for-installing-packages/</guid>
      <description>&lt;p&gt;By default, &lt;a href=&#34;https://pydevtools.com/handbook/reference/pip/&#34;&gt;pip&lt;/a&gt; allows installing packages into the global Python environment. This can lead to dependency conflicts and break system tools. Configuring pip to require a &lt;a href=&#34;https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment/&#34;&gt;virtual environment&lt;/a&gt; prevents accidental global installs.&lt;/p&gt;
&lt;h2&gt;Using an environment variable&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;using-an-environment-variable&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#using-an-environment-variable&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Set the &lt;code&gt;PIP_REQUIRE_VIRTUALENV&lt;/code&gt; environment variable to &lt;code&gt;true&lt;/code&gt; in your shell profile (e.g. &lt;code&gt;~/.bashrc&lt;/code&gt;, &lt;code&gt;~/.zshrc&lt;/code&gt;):&lt;/p&gt;
&lt;div class=&#34;hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code&#34;&gt;

&lt;div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;PIP_REQUIRE_VIRTUALENV&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&#34;hextra-code-copy-btn-container  hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0&#34;&gt;
  &lt;button
    class=&#34;hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50&#34;
    title=&#34;Copy code&#34;
    aria-label=&#34;Copy code&#34;
    data-copied-label=&#34;Copied!&#34;
  &gt;
    &lt;div class=&#34;hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
&lt;div class=&#34;hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
  &lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With this set, running &lt;code&gt;pip install&lt;/code&gt; outside a virtual environment produces an error:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to switch from pyenv to uv for managing Python versions</title>
      <link>https://pydevtools.com/handbook/how-to/how-to-switch-from-pyenv-to-uv-for-managing-python-versions/</link>
      <pubDate>Wed, 13 May 2026 06:43:22 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/how-to/how-to-switch-from-pyenv-to-uv-for-managing-python-versions/</guid>
      <description>&lt;p&gt;This guide shows how to transition from using pyenv to uv for managing Python versions. While pyenv has been a reliable tool for many years, uv offers faster performance and more integrated workflows.&lt;/p&gt;
&lt;h2&gt;Steps to Switch&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;steps-to-switch&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#steps-to-switch&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;h3&gt;1. Remove pyenv Integration From Shell&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;1-remove-pyenv-integration-from-shell&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#1-remove-pyenv-integration-from-shell&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Remove pyenv initialization from your shell configuration files:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open your shell configuration file (&lt;code&gt;.bashrc&lt;/code&gt;, &lt;code&gt;.zshrc&lt;/code&gt;, etc.)&lt;/li&gt;
&lt;li&gt;Remove or comment out lines like:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code&#34;&gt;

&lt;div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;eval&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;pyenv init -&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;eval&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;pyenv virtualenv-init -&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&#34;hextra-code-copy-btn-container  hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0&#34;&gt;
  &lt;button
    class=&#34;hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50&#34;
    title=&#34;Copy code&#34;
    aria-label=&#34;Copy code&#34;
    data-copied-label=&#34;Copied!&#34;
  &gt;
    &lt;div class=&#34;hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
&lt;div class=&#34;hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
  &lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ol start=&#34;3&#34;&gt;
&lt;li&gt;Reload your shell configuration:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code&#34;&gt;

&lt;div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;source&lt;/span&gt; ~/.bashrc  &lt;span class=&#34;c1&#34;&gt;# or .zshrc, etc.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&#34;hextra-code-copy-btn-container  hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0&#34;&gt;
  &lt;button
    class=&#34;hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50&#34;
    title=&#34;Copy code&#34;
    aria-label=&#34;Copy code&#34;
    data-copied-label=&#34;Copied!&#34;
  &gt;
    &lt;div class=&#34;hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
&lt;div class=&#34;hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
  &lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;2. Clean Up pyenv Installation&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;2-clean-up-pyenv-installation&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#2-clean-up-pyenv-installation&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Remove pyenv from your system:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to use pip in a uv virtual environment</title>
      <link>https://pydevtools.com/handbook/how-to/how-to-use-pip-in-a-uv-virtual-environment/</link>
      <pubDate>Wed, 13 May 2026 06:43:22 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/how-to/how-to-use-pip-in-a-uv-virtual-environment/</guid>
      <description>&lt;div class=&#34;hx:overflow-x-auto hx:mt-6 hx:flex hx:rounded-lg hx:border hx:py-2 hx:ltr:pr-4 hx:rtl:pl-4 hx:contrast-more:border-current hx:contrast-more:dark:border-current hx:border-amber-200 hx:bg-amber-100 hx:text-amber-900 hx:dark:border-amber-200/30 hx:dark:bg-amber-900/30 hx:dark:text-amber-200&#34;&gt;
  &lt;div class=&#34;hx:ltr:pl-3 hx:ltr:pr-2 hx:rtl:pr-3 hx:rtl:pl-2&#34;&gt;&lt;svg height=1.2em class=&#34;hx:inline-block hx:align-middle&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34; fill=&#34;none&#34; viewBox=&#34;0 0 24 24&#34; stroke-width=&#34;2&#34; stroke=&#34;currentColor&#34; aria-hidden=&#34;true&#34;&gt;&lt;path stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34; d=&#34;M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z&#34;/&gt;&lt;/svg&gt;&lt;/div&gt;

  &lt;div class=&#34;hx:w-full hx:min-w-0 hx:leading-7&#34;&gt;
    &lt;div class=&#34;hx:mt-6 hx:leading-7 hx:first:mt-0&#34;&gt;Only add &lt;a href=&#34;https://pydevtools.com/handbook/reference/pip/&#34;target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;pip&lt;/a&gt; to &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;uv&lt;/a&gt; environments when specifically needed for compatibility with tools that directly call pip. For regular package management, continue using uv commands (&lt;code&gt;uv add&lt;/code&gt;/&lt;code&gt;uv sync&lt;/code&gt;), which offer better performance and reliability.&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;When working with &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt;, you might occasionally need access to pip in your virtual environments, particularly when using tools that rely on pip directly, such as Jupyter&amp;rsquo;s &lt;code&gt;%pip&lt;/code&gt; magic command.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to use uv on NixOS</title>
      <link>https://pydevtools.com/handbook/how-to/how-to-use-uv-on-nixos/</link>
      <pubDate>Wed, 13 May 2026 06:43:22 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/how-to/how-to-use-uv-on-nixos/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt; ships as a single static binary that drops onto NixOS without a build step. The hard part is what happens next: uv&amp;rsquo;s &lt;a href=&#34;https://pydevtools.com/handbook/how-to/how-to-install-python-with-uv/&#34;&gt;managed Python interpreters&lt;/a&gt; are precompiled for a generic Linux that NixOS doesn&amp;rsquo;t pretend to be, so &lt;code&gt;uv sync&lt;/code&gt; and &lt;code&gt;uv run&lt;/code&gt; fail with &lt;code&gt;Could not start dynamically linked executable&lt;/code&gt; until you bridge the gap.&lt;/p&gt;
&lt;p&gt;This guide walks through the two patterns NixOS users reach for: enabling &lt;code&gt;nix-ld&lt;/code&gt; system-wide so uv-downloaded Python binaries find their dynamic linker, and pinning uv inside a &lt;code&gt;flake.nix&lt;/code&gt; dev shell that sets &lt;code&gt;LD_LIBRARY_PATH&lt;/code&gt; per project. Pick one based on whether you want uv to work everywhere on your system or only inside specific repositories.&lt;/p&gt;</description>
    </item>
    <item>
      <title>pyenv: Python Version Manager</title>
      <link>https://pydevtools.com/handbook/reference/pyenv/</link>
      <pubDate>Tue, 05 May 2026 06:54:22 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/reference/pyenv/</guid>
      <description>&lt;p&gt;pyenv is a command-line tool for installing, managing, and switching between multiple Python interpreter versions on macOS and Linux. It intercepts Python commands through shell shims, routing them to whichever interpreter version is active for the current directory, user, or system.&lt;/p&gt;
&lt;h2&gt;When to use pyenv&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;when-to-use-pyenv&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#when-to-use-pyenv&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;pyenv fits workflows where Python version management should remain separate from package management. It pairs with &lt;a href=&#34;https://pydevtools.com/handbook/reference/pip/&#34;&gt;pip&lt;/a&gt;, &lt;a href=&#34;https://pydevtools.com/handbook/reference/venv/&#34;&gt;venv&lt;/a&gt;, or any other packaging tool without imposing opinions on how dependencies are managed. If you want a single tool that also handles dependencies and virtual environments, &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt; covers version management alongside those workflows.&lt;/p&gt;</description>
    </item>
    <item>
      <title>pyenv-virtualenv: Python Virtual Environment Plugin</title>
      <link>https://pydevtools.com/handbook/reference/pyenv-virtualenv/</link>
      <pubDate>Tue, 28 Apr 2026 21:54:51 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/reference/pyenv-virtualenv/</guid>
      <description>&lt;p&gt;pyenv-virtualenv is a plugin for &lt;a href=&#34;https://pydevtools.com/handbook/reference/pyenv/&#34;&gt;pyenv&lt;/a&gt; that creates and manages &lt;a href=&#34;https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment/&#34;&gt;virtual environments&lt;/a&gt; tied to specific Python versions. It extends pyenv with a &lt;code&gt;pyenv virtualenv&lt;/code&gt; command and hooks into shell initialization so the right environment activates whenever a directory&amp;rsquo;s &lt;a href=&#34;https://pydevtools.com/handbook/explanation/what-is-a-python-version-file/&#34;&gt;&lt;code&gt;.python-version&lt;/code&gt; file&lt;/a&gt; names it.&lt;/p&gt;
&lt;h2&gt;When to use pyenv-virtualenv&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;when-to-use-pyenv-virtualenv&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#when-to-use-pyenv-virtualenv&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;pyenv-virtualenv fits teams already running pyenv who want directory-scoped virtual environments without changing version managers. The plugin pairs with &lt;a href=&#34;https://pydevtools.com/handbook/reference/pip/&#34;&gt;pip&lt;/a&gt; or any other installer because it only handles environment creation and activation. Teams looking for a single tool that combines Python version management, virtual environments, lockfiles, and dependency resolution may prefer &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt;. For pyenv users moving to uv, see &lt;a href=&#34;https://pydevtools.com/handbook/how-to/how-to-switch-from-pyenv-to-uv-for-managing-python-versions/&#34;&gt;How to switch from pyenv to uv for managing Python versions&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Should I use Homebrew to install Python?</title>
      <link>https://pydevtools.com/handbook/explanation/should-i-use-homebrew-to-install-python/</link>
      <pubDate>Mon, 04 May 2026 08:02:03 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/explanation/should-i-use-homebrew-to-install-python/</guid>
      <description>&lt;p&gt;Homebrew ships Python because dozens of its own packages depend on it. Tools like &lt;code&gt;glib&lt;/code&gt;, &lt;code&gt;cmake&lt;/code&gt;, and &lt;code&gt;awscli&lt;/code&gt; all pull in Python as a build or runtime dependency. When Homebrew installs Python, it is satisfying &lt;em&gt;its own&lt;/em&gt; dependency graph, not setting up a development environment for you.&lt;/p&gt;
&lt;p&gt;This distinction matters because Homebrew treats Python the same way it treats any other dependency: as something to keep current. Running &lt;code&gt;brew upgrade&lt;/code&gt; can bump Python from 3.12 to 3.13 without warning, removing the previous minor version&amp;rsquo;s &lt;code&gt;site-packages&lt;/code&gt; directory in the process.&lt;/p&gt;</description>
    </item>
    <item>
      <title>venv: Python Built-in Virtual Environment Module</title>
      <link>https://pydevtools.com/handbook/reference/venv/</link>
      <pubDate>Tue, 28 Apr 2026 21:54:51 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/reference/venv/</guid>
      <description>&lt;p&gt;venv is Python&amp;rsquo;s built-in module for creating &lt;a href=&#34;https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment/&#34;&gt;virtual environments&lt;/a&gt;. Included in the standard library since Python 3.3, it creates lightweight, isolated directory trees containing a Python interpreter and a dedicated &lt;code&gt;site-packages&lt;/code&gt; directory for project-specific dependencies.&lt;/p&gt;
&lt;h2&gt;When to use venv&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;when-to-use-venv&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#when-to-use-venv&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;venv fits any project that needs an isolated Python environment using only the standard library, with no extra installs or dependencies to vet. It is the default choice on Python 3.3 or later when a third-party tool like &lt;a href=&#34;https://pydevtools.com/handbook/reference/virtualenv/&#34;&gt;virtualenv&lt;/a&gt; or &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt; cannot be added (locked-down systems or minimal CI images that ship Python and nothing else). For new work where third-party tools are available, &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt; creates and manages virtual environments automatically through &lt;code&gt;uv run&lt;/code&gt; and &lt;code&gt;uv sync&lt;/code&gt;, removing the manual create-and-activate steps venv requires.&lt;/p&gt;</description>
    </item>
    <item>
      <title>virtualenv: Python Virtual Environment Tool</title>
      <link>https://pydevtools.com/handbook/reference/virtualenv/</link>
      <pubDate>Tue, 05 May 2026 06:54:22 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/reference/virtualenv/</guid>
      <description>&lt;p&gt;virtualenv creates isolated Python virtual environments. Virtual environments are self-contained directories that contain a Python installation for a particular version of Python, plus additional packages.&lt;/p&gt;
&lt;h2&gt;When to use virtualenv&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;when-to-use-virtualenv&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#when-to-use-virtualenv&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;virtualenv fits projects that need broader Python version support than the standard library&amp;rsquo;s &lt;a href=&#34;https://pydevtools.com/handbook/reference/venv/&#34;&gt;venv&lt;/a&gt; module offers, or that benefit from its faster environment creation through cached seed packages. Most modern projects on Python 3.3 or later can use venv, which ships in the standard library and covers the same core workflow without an extra dependency. For new work, &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt; creates and manages &lt;a href=&#34;https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment/&#34;&gt;virtual environments&lt;/a&gt; automatically as part of its run and sync commands, removing most of the manual steps either tool requires.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is a .python-version file?</title>
      <link>https://pydevtools.com/handbook/explanation/what-is-a-python-version-file/</link>
      <pubDate>Tue, 07 Apr 2026 14:40:41 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/explanation/what-is-a-python-version-file/</guid>
      <description>&lt;p&gt;A &lt;code&gt;.python-version&lt;/code&gt; file is a simple text file that specifies which Python version should be used for a particular project or directory. When present, Python version management tools like &lt;a href=&#34;https://pydevtools.com/handbook/reference/uv/&#34;&gt;uv&lt;/a&gt; and &lt;a href=&#34;https://pydevtools.com/handbook/reference/pyenv/&#34;&gt;pyenv&lt;/a&gt; automatically use the specified Python version when working in that directory.&lt;/p&gt;
&lt;p&gt;The file contains a single line with a Python version specification, e.g.,&lt;/p&gt;
&lt;div class=&#34;hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code&#34;&gt;

&lt;div&gt;&lt;pre&gt;&lt;code&gt;3.11.5&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;hextra-code-copy-btn-container  hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0&#34;&gt;
  &lt;button
    class=&#34;hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50&#34;
    title=&#34;Copy code&#34;
    aria-label=&#34;Copy code&#34;
    data-copied-label=&#34;Copied!&#34;
  &gt;
    &lt;div class=&#34;hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
&lt;div class=&#34;hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4&#34;&gt;&lt;/div&gt;
  &lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This approach provides environment-specific Python version control without requiring manual activation or configuration each time you work on a project.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is a Virtual Environment?</title>
      <link>https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment/</link>
      <pubDate>Tue, 28 Apr 2026 21:54:51 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/explanation/what-is-a-virtual-environment/</guid>
      <description>&lt;p&gt;A virtual environment is an isolated Python runtime environment that enables development with project-specific dependencies and Python versions without interference from other projects or the system Python installation.&lt;/p&gt;
&lt;div class=&#34;hx:overflow-x-auto hx:mt-6 hx:flex hx:rounded-lg hx:border hx:py-2 hx:ltr:pr-4 hx:rtl:pl-4 hx:contrast-more:border-current hx:contrast-more:dark:border-current hx:border-blue-200 hx:bg-blue-100 hx:text-blue-900 hx:dark:border-blue-200/30 hx:dark:bg-blue-900/30 hx:dark:text-blue-200&#34;&gt;
  &lt;div class=&#34;hx:ltr:pl-3 hx:ltr:pr-2 hx:rtl:pr-3 hx:rtl:pl-2&#34;&gt;&lt;svg height=1.2em class=&#34;hx:inline-block hx:align-middle&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34; fill=&#34;none&#34; viewBox=&#34;0 0 24 24&#34; stroke-width=&#34;2&#34; stroke=&#34;currentColor&#34; aria-hidden=&#34;true&#34;&gt;&lt;path stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34; d=&#34;M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z&#34;/&gt;&lt;/svg&gt;&lt;/div&gt;

  &lt;div class=&#34;hx:w-full hx:min-w-0 hx:leading-7&#34;&gt;
    &lt;div class=&#34;hx:mt-6 hx:leading-7 hx:first:mt-0&#34;&gt;Think of a virtual environment like a clean workshop for each project. Instead of having all your tools mixed in one garage (which could lead to version conflicts or missing dependencies), each project gets its own dedicated space with precisely the tools it needs.&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Without virtual environments, several critical problems emerge when installing Python packages globally:&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is PEP 668?</title>
      <link>https://pydevtools.com/handbook/explanation/what-is-pep-668/</link>
      <pubDate>Tue, 07 Apr 2026 14:40:41 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/explanation/what-is-pep-668/</guid>
      <description>&lt;p&gt;If &lt;a href=&#34;https://pydevtools.com/handbook/reference/pip/&#34;&gt;pip&lt;/a&gt; has ever refused with &lt;code&gt;error: externally-managed-environment&lt;/code&gt;, that was PEP 668 at work.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://peps.python.org/pep-0668/&#34;target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PEP 668&lt;/a&gt; (&amp;ldquo;Marking Python base environments as externally managed&amp;rdquo;) defines a mechanism for OS distributors to protect their Python installations from accidental modification by pip. Accepted in June 2022, it has since been adopted by major Linux distributions and by Homebrew on macOS.&lt;/p&gt;
&lt;h2&gt;Why it exists&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;why-it-exists&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#why-it-exists&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Operating systems install Python packages into a shared &lt;code&gt;site-packages&lt;/code&gt; directory. System tools depend on those packages being specific versions. Running &lt;code&gt;pip install&lt;/code&gt; into that same directory can overwrite OS-managed files, breaking utilities like &lt;code&gt;apt&lt;/code&gt; on Debian or &lt;code&gt;dnf&lt;/code&gt; on Fedora. Before PEP 668, nothing stopped users from doing this by accident. For more background, see &lt;a href=&#34;https://pydevtools.com/handbook/explanation/why-should-i-avoid-system-python/&#34;&gt;Why should I avoid using the system Python?&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why should I avoid using the system Python?</title>
      <link>https://pydevtools.com/handbook/explanation/why-should-i-avoid-system-python/</link>
      <pubDate>Wed, 22 Apr 2026 16:51:52 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/explanation/why-should-i-avoid-system-python/</guid>
      <description>&lt;p&gt;The &amp;ldquo;system Python&amp;rdquo; is the &lt;a href=&#34;https://pydevtools.com/handbook/explanation/what-is-a-python-interpreter/&#34;&gt;Python interpreter&lt;/a&gt; that ships with your operating system. On macOS and most Linux distributions, it lives at &lt;code&gt;/usr/bin/python3&lt;/code&gt;. Windows doesn&amp;rsquo;t ship Python by default, but a system-wide install from python.org or the Microsoft Store fills the same role and runs into most of the same problems.&lt;/p&gt;
&lt;p&gt;This interpreter exists for the operating system, not for development work. Using it for your own projects causes three categories of problems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why should I use a virtual environment?</title>
      <link>https://pydevtools.com/handbook/explanation/why-should-i-use-a-virtual-environment/</link>
      <pubDate>Tue, 05 May 2026 06:54:22 -0400</pubDate>
      <author>Tim Hopper</author>
      <guid>https://pydevtools.com/handbook/explanation/why-should-i-use-a-virtual-environment/</guid>
      <description>&lt;p&gt;A virtual environment is an isolated Python runtime environment that allows you to work on different Python projects with different dependencies without conflicts. Virtual environments are fundamental to Python development.&lt;/p&gt;
&lt;h2&gt;The Problem Virtual Environments Solve&lt;span class=&#34;hx:absolute hx:-mt-20&#34; id=&#34;the-problem-virtual-environments-solve&#34;&gt;&lt;/span&gt;
    &lt;a href=&#34;#the-problem-virtual-environments-solve&#34; class=&#34;subheading-anchor&#34; aria-label=&#34;Permalink for this section&#34;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;details class=&#34;hx:last-of-type:mb-0 hx:rounded-lg hx:bg-neutral-50 hx:dark:bg-neutral-800 hx:p-2 hx:mt-4 hx:group&#34; open&gt;
  &lt;summary class=&#34;hx:flex hx:items-center hx:cursor-pointer hx:select-none hx:list-none hx:p-1 hx:rounded-sm hx:transition-colors hx:hover:bg-gray-100 hx:dark:hover:bg-neutral-800 hx:before:mr-1 hx:before:inline-block hx:before:transition-transform hx:before:content-[&#39;&#39;] hx:dark:before:invert hx:rtl:before:rotate-180 hx:group-open:before:rotate-90&#34;&gt;
    &lt;strong class=&#34;hx:text-lg&#34;&gt;Real-world analogy&lt;/strong&gt;
  &lt;/summary&gt;
  &lt;div class=&#34;hx:p-2 hx:overflow-hidden&#34;&gt;
    Think of a virtual environment like a clean workshop for each project. Instead of having all your tools mixed together in one garage (which could lead to version conflicts or missing dependencies), each project gets its own dedicated space with exactly the tools it needs.
  &lt;/div&gt;
&lt;/details&gt;
&lt;p&gt;When you install Python packages globally (directly into your system Python), several problems arise:&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
