<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Brandon Young on Medium]]></title>
        <description><![CDATA[Stories by Brandon Young on Medium]]></description>
        <link>https://medium.com/@datagumshoe?source=rss-1c022525134f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qOjNzDhD_6uLJ5Dd6U72_w.jpeg</url>
            <title>Stories by Brandon Young on Medium</title>
            <link>https://medium.com/@datagumshoe?source=rss-1c022525134f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 20:45:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@datagumshoe/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using UV and Conda Together Effectively: A Fast, Flexible Workflow]]></title>
            <link>https://medium.com/@datagumshoe/using-uv-and-conda-together-effectively-a-fast-flexible-workflow-d046aff622f0?source=rss-1c022525134f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d046aff622f0</guid>
            <category><![CDATA[conda]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[uv]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[anaconda]]></category>
            <dc:creator><![CDATA[Brandon Young]]></dc:creator>
            <pubDate>Sat, 08 Mar 2025 16:01:02 GMT</pubDate>
            <atom:updated>2025-03-08T16:01:02.373Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SpN3NRZreyeQWjtR5bV9Bg.png" /><figcaption>look at these love birds</figcaption></figure><p>Python package management can be messy, especially when dealing with large environments, dependency conflicts, and slow installs. While Conda is excellent for managing system-level dependencies and isolated environments, UV is an ultra-fast package manager that can significantly speed up Python package installation.</p><p>But can they work together? Absolutely. By combining Conda for environment management and UV for package installations, you can get the best of both worlds: Conda’s flexibility with system dependencies and UV’s blazing-fast package installs. This workflow is particularly valuable for data scientists, machine learning engineers, and anyone working with complex Python environments where installation speed and dependency management are critical.</p><p>This article’ll explore how to use UV effectively inside a Conda environment, why you might want to use it, and the best practices to avoid common pitfalls.</p><h3>TL;DR Best Practices</h3><ul><li>✔️ Use Conda for system dependencies</li><li>✔️ Use UV for Python package installations</li><li>✔️ Always check for conflicts between Conda and UV packages</li><li>✔️ Export and document dependencies for reproducibility</li></ul><h3>Why Use UV Inside a Conda Environment?</h3><p>Conda and UV serve different purposes:</p><p><strong>Conda:</strong> Manages environments and system dependencies (e.g., CUDA for GPU acceleration, MKL for optimized linear algebra, BLAS/LAPACK numerical libraries, HDF5 for large dataset storage, R language runtime, and graphics libraries like Qt or GTK). These system-level dependencies often involve compiled C/C++ code that’s platform-specific and challenging to install through PyPI alone.</p><p><strong>UV:</strong> A lightning-fast alternative to pip for managing Python packages.</p><p>While Conda can install Python packages, they are often slower and may have outdated versions, and they might not have all the packages or versions you may need. Pip is a common alternative, but it isn’t always efficient. UV, however, leverages a Rust-based approach to dramatically speed up installations while still maintaining compatibility with PyPI.</p><p>In my testing, UV installed packages approximately 3–5x faster than pip, with complex environments showing even more significant improvements. A project with 50+ dependencies that took 3 minutes with pip installed in just 45 seconds with UV.</p><h3>Install Conda and Create an Environment</h3><p>If you haven’t installed Conda (or Miniconda/Mamba), download and install it from Anaconda or Miniconda. I like Miniconda; it’s lightweight, and I have found the GUI version of Anaconda incredibly bloated and slow.</p><p>Create a new Conda environment with Python:</p><pre>conda create -n myenv python=3.11<br>conda activate myenv</pre><h3>Install UV</h3><p>Since UV is a standalone package manager, install it via Pip inside your Conda environment:</p><pre>pip install uv</pre><p>You can verify the install with the following:</p><pre>uv --version</pre><h3>Installing Packages with UV in a Conda Environment</h3><p>Once UV is installed, you can install Python packages much faster than Pip. UV particularly shines when installing multiple packages simultaneously or dealing with complex dependency trees. For example:</p><pre># Installing a complex web development stack<br>uv add fastapi uvicorn sqlalchemy alembic pydantic</pre><pre># Data science toolkit installation<br>uv add pandas scikit-learn matplotlib seaborn</pre><h3>Version-Specific Installations</h3><p>UV makes it easy to manage package versions and constraints:</p><h4>Installing a specific version:</h4><pre>uv add requests=2.1.2</pre><h4>Change the bounds of a package’s constraints:</h4><pre>uv add &#39;requests&lt;3.0.0&#39;</pre><h4>Make a dependency platform-specific:</h4><pre>uv add &#39;requests; sys_platform=&quot;linux&quot;&#39;</pre><h3>Troubleshooting Common Issues</h3><p>When combining UV and Conda, you might encounter a few common challenges. Here’s how to address them:</p><p>Firstly, always check the official documentation here: <a href="https://docs.astral.sh/uv/">https://docs.astral.sh/uv/</a></p><h4>Package Not Found in UV But Available in Conda</h4><p>If UV can’t find a package that Conda has:</p><pre># Try installing with Conda instead<br>conda install package-name</pre><h4>Dependency Conflicts Between UV and Conda Packages</h4><p>If you see “Dependency conflict” errors:</p><pre># Check which versions are installed<br>pip list | grep package-name<br>conda list | grep package-name</pre><pre># Reinstall the conflicting package with the same version in both<br>uv pip install package-name==specific-version</pre><h4>UV Installation Breaks After Conda Environment Update</h4><p>If UV stops working after a Conda update:</p><pre># Reinstall UV<br>pip uninstall uv -y<br>pip install uv</pre><h4>Virtual Environment Confusion</h4><p>If your packages seem to install but aren’t accessible:</p><pre># Verify which Python interpreter is being used<br>which python<br>uv pip list </pre><pre># also make sure your terminal has something like mine below<br>(myenv) brandon@ODIN:~$</pre><h3>Best Practices for Managing Dependencies</h3><h4>Use Conda for System Dependencies</h4><p>Some packages (like TensorFlow, PyTorch, and OpenCV) rely on system-level dependencies that Pip and UV can’t handle. Install those with Conda first:</p><pre>conda install -n myenv pytorch torchvision torchaudio -c pytorch<br>uv add tqdm requests</pre><h4>Use UV for Pure Python Packages</h4><p>UV is best for pure Python packages. Anything that doesn’t require system libraries (like requests, pandas, or fastapi) should be installed with UV.</p><pre>uv add requests pandas fastapi tqdm rich flask poetry black</pre><h4>Freeze Dependencies for Reproducibility</h4><p>Export your environment for easy sharing:</p><pre>uv pip freeze &gt; requirements.txt<br>conda env export &gt; environment.yml</pre><p>And recreate it later:</p><pre>conda env create -f environment.yml<br>uv add -r requirements.txt</pre><h3>Limitations &amp; Caveats</h3><p>🚧 <strong>UV doesn’t handle system-level dependencies</strong><br>UV works great for Python packages but can’t install system dependencies like CUDA, OpenCV, or FFMPEG. Use Conda for those.</p><p>🚧 <strong>Conda and UV package versions may conflict</strong><br>If Conda and UV install different versions of the same package, it can cause issues. Always check versions using:</p><pre>pip list | grep &lt;package-name&gt;</pre><p>🚧 <strong>UV’s ecosystem is still growing</strong><br>Since UV is newer than Pip, not every package may work flawlessly. Always test before using it in production.</p><h3>When This Approach Might Not Be Ideal</h3><p>While combining UV and Conda offers many advantages, there are situations where this hybrid approach might not be the best choice:</p><h3>Simple Projects with Few Dependencies</h3><p>For straightforward projects with minimal dependencies, the added complexity of managing two package managers might be unnecessary. A simple virtual environment with pip might suffice.</p><h3>Production Environments Requiring Strict Validation</h3><p>In highly regulated environments where every package and dependency must be thoroughly validated, a single, well-established package manager like Conda alone may be preferred for consistency and auditability.</p><p>This hybrid approach offers the advantage of flexibility while streamlining Python package management. If you’re experiencing delays with Conda commands, consider trying UV — it can significantly improve your workflow.</p><p>Have you tried combining UV and Conda in your projects? I’d love to hear about your experiences in the comments below. What speedups have you seen? Any challenges you’ve encountered? Or perhaps you’ve discovered other optimizations that complement this workflow?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d046aff622f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>