Skip to content

Instantly share code, notes, and snippets.

@MayerDaniel
Created November 16, 2023 17:57
Show Gist options
  • Save MayerDaniel/eef6d23fd928d426ab45f72a52907c45 to your computer and use it in GitHub Desktop.
Save MayerDaniel/eef6d23fd928d426ab45f72a52907c45 to your computer and use it in GitHub Desktop.
pyenv banteg

it has come to my attention that people still have problems with their python environment.

  1. install pyenv with curl https://pyenv.run | bash
  2. pyenv install 3.11 now you have the latest python (it can also install pypy, anaconda and many others if you need)
  3. pyenv global 3.11 now you have a global python
  4. pyenv virtualenv 3.11 ape now you have a virtualenv
  5. pyenv local ape now the project folder contains .python-version which automatically activates the environment when you enter the folder

read more about pyenv here https://github.com/pyenv/pyenv-installer

now it's time to develop your program. there are many advanced packaging tools (read about poetry or hatch to see if you need the advanced features), but we will go with the simplest one.

  1. pip install flit now you have a packaging tool
  2. flit init now you have a pyproject.toml, which is a modern way to specify packages
  3. flit install now you have installed your project for development
  4. flit publish now you have uploaded it to pypi for everyone to use

read more on flit here https://flit.pypa.io/en/stable/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment