Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bootstrapping your Local Python Environment

Bootstrapping your Local Python Environment

You cracked open your brand new Mac or Linux dream machine and low and behold, it has Python out-of-the-box and ready to roll… Or so you think? Maybe you want to get started doing Python development on Windows and see that you can grab Python easily from the Microsoft Store. Should you? Let’s talk about getting started with the end in mind and making sure your development computer doesn’t become the next superfund site https://xkcd.com/1987/. We’ll quickly go through a tour of the various options such as pyenv, venv, virtualenv, conda and Docker as great ways to make sure you can develop in a sane environment.

Calvin Hendryx-Parker

July 08, 2021
Tweet

More Decks by Calvin Hendryx-Parker

Other Decks in Technology

Transcript

  1. LET’S SET OUR INTENTION Photo by on $ python -m

    this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain it may be a good idea Sean Stratton Unsplash
  2. PYTHON LIVES IN MANY PLACES » Python provided by OS

    (macOS, RedHat, Ubuntu) » Python installed from an App Store (Microsoft Store) » Python installed from installer » Python installed from a Package Manager (apt, , ) » Python installed by a Python Distribution ( , ) python.org brew chocolatey ActiveState Anaconda
  3. SO WHY SHOULD YOU CARE ABOUT ALL OF THIS? Photo

    by on Fermin Rodriguez Penelas Unsplash
  4. STAY ZEN Beautiful is better than ugly. Explicit is better

    than implicit. Simple is better than complex.
  5. PYENV » Change the global Python version on a per-user

    basis » Per-project Python versions » Override the Python version with an environment variable » Search commands from multiple versions of Python at a time https://github.com/pyenv/pyenv#installation https://pyenv-win.github.io/pyenv-win/
  6. PIPX pipx is ready to go! ✨ 🌟 ✨ https://pypa.github.io/pipx/

    $ brew install pipx $ pipx ensurepath LET’S DO SOME DAMAGE
  7. PIPX pipx is ready to go! ✨ 🌟 ✨ https://pypa.github.io/pipx/

    $ brew install pipx $ pipx ensurepath LET’S DO SOME DAMAGE $ pipx install httpie installed package httpie 2.4.0, Python 3.9.6 These apps are now globally available - http - https done! ✨ 🌟 ✨
  8. BUT WHAT ABOUT … » » » » » »

    Anaconda Python and Conda ActiveState Python pipenv poetry PDM pyproject.toml