Pinning Dependencies the Right Way for ML Projects

📰 Medium · DevOps

Learn how to pin dependencies correctly for ML projects to avoid version drift issues and ensure reproducibility

intermediate Published 25 Jun 2026
Action Steps
  1. Use pip-compile to generate a requirements.txt file with pinned dependencies
  2. Specify exact versions of libraries in your requirements.txt file
  3. Use a virtual environment to isolate dependencies and ensure reproducibility
  4. Regularly update and re-pin dependencies to ensure compatibility
  5. Test your project with different dependency versions to ensure robustness
Who Needs to Know This

Data scientists and ML engineers can benefit from this knowledge to ensure their projects are reliable and reproducible

Key Insight

💡 Pinning dependencies is essential for ML projects because loose dependency ranges can lead to silent breaks in compiled, binary-level contracts

Share This
💡 Pinning dependencies is crucial for ML projects! Learn how to do it right to avoid version drift issues and ensure reproducibility

Key Takeaways

Learn how to pin dependencies correctly for ML projects to avoid version drift issues and ensure reproducibility

Full Article

Title: Pinning Dependencies the Right Way for ML Projects

URL Source: https://medium.com/@sundarbalamurugan/pinning-dependencies-the-right-way-for-ml-projects-b35c82042d44?source=rss------devops-5

Published Time: 2026-06-25T06:57:45Z

Markdown Content:
[Sitemap](https://medium.com/sitemap/sitemap.xml)

[Open in app](https://play.google.com/store/apps/details?id=com.medium.reader&referrer=utm_source%3DmobileNavBar&source=post_page---top_nav_layout_nav-----------------------------------------)

Sign up

[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40sundarbalamurugan%2Fpinning-dependencies-the-right-way-for-ml-projects-b35c82042d44&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

[](https://medium.com/?source=post_page---top_nav_layout_nav-----------------------------------------)

Get app

[Write](https://medium.com/m/signin?operation=register&redirect=https%3A%2F%2Fmedium.com%2Fnew-story&source=---top_nav_layout_nav-----------------------new_post_topnav------------------)

[Search](https://medium.com/search?source=post_page---top_nav_layout_nav-----------------------------------------)

Sign up

[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40sundarbalamurugan%2Fpinning-dependencies-the-right-way-for-ml-projects-b35c82042d44&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

![Image 1: Unknown user](https://miro.medium.com/v2/resize:fill:64:64/1*dmbNkD5D-u45r44go_cf0g.png)

Member-only story

# **Pinning Dependencies the Right Way for ML Projects**

[![Image 2: Sundar Balamurugan](https://miro.medium.com/v2/resize:fill:64:64/1*EToNSN_FrszFMvo_nZ5NEQ.png)](https://medium.com/@sundarbalamurugan?source=post_page---byline--b35c82042d44---------------------------------------)

[Sundar Balamurugan](https://medium.com/@sundarbalamurugan?source=post_page---byline--b35c82042d44---------------------------------------)

2 min read

·

5 days ago

[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fvote%2Fp%2Fb35c82042d44&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40sundarbalamurugan%2Fpinning-dependencies-the-right-way-for-ml-projects-b35c82042d44&user=Sundar+Balamurugan&userId=e061a0ec0b9b&source=---header_actions--b35c82042d44---------------------clap_footer------------------)

--

[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Frepost%2Fp%2Fb35c82042d44&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40sundarbalamurugan%2Fpinning-dependencies-the-right-way-for-ml-projects-b35c82042d44&user=Sundar+Balamurugan&userId=e061a0ec0b9b&source=---header_actions--b35c82042d44---------------------repost_header------------------)

[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fbookmark%2Fp%2Fb35c82042d44&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40sundarbalamurugan%2Fpinning-dependencies-the-right-way-for-ml-projects-b35c82042d44&source=---header_actions--b35c82042d44---------------------bookmark_footer------------------)

[Listen](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2Fplans%3Fdimension%3Dpost_audio_button%26postId%3Db35c82042d44&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40sundarbalamurugan%2Fpinning-dependencies-the-right-way-for-ml-projects-b35c82042d44&source=---header_actions--b35c82042d44---------------------post_audio_button------------------)

Share

Press enter or click to view image in full size

![Image 3](https://medium.com/@sundarbalamurugan/pinning-dependencies-the-right-way-for-ml-projects-b35c82042d44?source=rss------devops-5)

## Why ML is different

In ordinary web projects, loose dependency ranges are usually fine. In machine learning, they are dangerous, because the libraries are bound together by compiled, binary-level contracts that break silently when versions drift apart. signspell taught me this the hard way.
Read full article → ← Back to Reads

Related Videos

Is coding becoming obsolete? | Find out what's the new fundamentals
Is coding becoming obsolete? | Find out what's the new fundamentals
SCALER
SQLite3 Tutorial - Learn SQL for Python in 17 Minutes
SQLite3 Tutorial - Learn SQL for Python in 17 Minutes
Thomas Janssen
How to Train AI to Play Games ? How AI Learns to Play ? Several Methods EXPLAINED
How to Train AI to Play Games ? How AI Learns to Play ? Several Methods EXPLAINED
MaxonShire
Introduction to Machine Learning: Lesson 05
Introduction to Machine Learning: Lesson 05
Stephen Blum
Pytorch Embedding Model Part 1
Pytorch Embedding Model Part 1
Stephen Blum
Introduction to Machine Learning: Lesson 04
Introduction to Machine Learning: Lesson 04
Stephen Blum