Pipenv is so snazzy.

Here’s a list of problems it solves: https://realpython.com/pipenv-guide/

My favorite (minor) feature is that I now no longer have to .gitignore all the virtualenv directories for Python projects.

Thoughtbot has a great guide on getting started: https://robots.thoughtbot.com/how-to-manage-your-python-projects-with-pipenv

Recently, there was a “TypeError: ‘module’ object is not callable” bug (with a workaround) but looks like it’s been fixed: https://github.com/pypa/pipenv/issues/2871

This post is a gift to my future self for when I no longer writer Python daily and need a refresher.

Chris Yeh has a wonderful post on the correct syntax to write import statements in Python.

The essence is, if you have a directory structure like:

awesome_project/
    run.py
    foo/
        __init__.py
        bar.py
        baz.py

In run.py:

from foo import bar

bar.Bar()

In baz.py:

from .bar import Bar

Bar()