Python Versions and Dependencies Made Easy

switowski


Description:

Managing Python versions and dependencies can be painful. JavaScript developers have their "node_modules" folders, but we don't have "python_modules" (yet!) in Python. Instead, we have those mysterious virtual environments. And if you also want to switch between different Python versions, it can quickly turn into a mess.

It doesn't have to be that way. With a few simple tools and practices, you can easily tame Python and its dependencies. In this talk, I'm going to show you how to do this.

I will talk about:

  • How to manage Python versions with pyenv and set different versions for a folder or a shell session?
  • What are virtual environments, what's the difference between different tools (venv, virtualenvwrapper, conda, etc.), and how to use them?
  • How to separate global packages with pipx (and why you should do this)

Prerequisites:

You just need to know how to install packages with pip.

Video URL:

https://www.youtube.com/watch?v=5jKWqr11twY

Content URLs:

Outline:

  1. Who am I? (1 min)
  2. Problem with tools in Python projects (2 min)
  3. What is system Python (2 min)
  4. What is pyenv (1 min)
  5. How to install pyenv (2 min)
  6. How to use pyenv (3 min)
  7. Problem with pip (2 min)
  8. What are virtual environments (2 min)
  9. Typical workflow with virtual environments (3 min)
  10. virtualenvwrapper - an alternative tool for managing virtual environments (4 min)
  11. Why global Python packages can get messy? (1 min)
  12. What's pipx (1 min)
  13. How to install and use pipx (4 min)
  14. Conclusions (2 min)

Slides (THOSE ARE SLIDES FROM AN OLD VERSION OF THIS TALK THAT TOOK 45 MINUTES, SO THEY ARE SLIGHTLY DIFFERENT FROM WHAT I WILL PRESENT): https://www.slideshare.net/secret/wCvwYiLnpXuLER

Speaker Info:

Sebastian is a Python consultant and trainer based in Poland. He started his journey with programming as a software developer at CERN, where he fell in love with Python (and teaching). Now he is helping companies untangle their complicated architecture and build all sorts of interesting Python projects.

In his spare time, he talks about Python, best practices in programming, and productivity.

Speaker Links:

Some of my most popular talks include:

  • "Modern Python Developer's Toolkit" workshop - the most popular video from PyConUS 2020: https://www.youtube.com/watch?v=WkUBx3g2QfQ&
  • "Writing Faster Python" talk - 5th most popular EuroPython talk of all time: https://www.youtube.com/watch?v=YjHsOrOOSul

You can see more of my talks here: https://switowski.com/talks

Section: Developer tools and automation
Type: Talks
Target Audience: Beginner
Last Updated: