Integrating direnv with python 3

2020-06-12 18:15:00 +0000

By now you should be using Python 3.x. You can integrate it with direnv (2.21 or newer) by putting the following in your .envrc

layout pyenv 3.6.7

Note that pyenv needs to be in your PATH. If you installed pyenv by following the instructions from earlier, then do this:

PATH_add $HOME/.direnv/pyenv/bin
layout pyenv 3.6.7

Note that this expects Python to be installed in $HOME/.pyenv/versions, so the python-build instructions need to be changed as follows:

~/.direnv/bin/python-build 3.6.7 ~/.pyenv/versions/3.6.7

And you’re done.