Skip to content

Instantly share code, notes, and snippets.

@jsugarman
Last active July 18, 2020 13:16
Show Gist options
  • Save jsugarman/001d3c0a293fb8af3cd007ad3e9aba93 to your computer and use it in GitHub Desktop.
Save jsugarman/001d3c0a293fb8af3cd007ad3e9aba93 to your computer and use it in GitHub Desktop.
laa-fee-calculator pyenv setup

Setup fee calculator with pyenv

Setup pyenv globally

Create a virtual env

In fee calculator app root dir create a virtual env for a specific version of python (I am using 3.8.3, latest at time of writing), and give it a name.

$ cd .../laa-fee-calcultor
$ pyenv virtualenv 3.8.3 laa-fee-calculator

# confirm creation
$ pyenv versions
=>
  system
 *3.8.3
  3.8.3/envs/laa-fee-calculator
  laa-fee-calculator

Acivate virtualenv and setup/install fee calculator inside it

$ pyenv activate laa-fee-calculator
$ pip install --upgrade setuptools pip wheel readline
$ pip install -r requirements.txt

Default this dir to using that named environment

pyenv local laa-fee-calculator

this creates .python-version in the root of the app with the named virtualenv in it. This file is .gitignore'd

For this to work you will need to add this to your .bash_profile

eval "$(pyenv virtualenv-init -)"

Cheatsheet

# pyenv
$ pyenv activate laa-fee-calculator
$ pyenv versions
$ pyenv deactivate

# django related
$ ./manage.py shell
$ ./manage.py dbshell

# data related
$ ./manage.py cleardata
$ ./manage.py loadalldata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment