Step 1: Choose A Base Language
For this series I will be using Python3. Here are some basics to get things setup.
A quick background on my local development setup. This is probably not too different than what you may be using. I use a Mac M1, Visual Studio Code, and Git for the basic setup. We’ll get started with installing Python.
Install Python
Out-of-the-box macOS comes with Python 2.7; we’ll want to use the latest and greatest, right?
There are many ways to install Python. I meant to check ASDF VM for installing different language runtimes, so let’s try.
Setup ASDF
From the docs, there are many ways for all sorts of platforms. I am using Oh My Zsh; this makes it a bit easier because there is a plugin.
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
Cloning into '/Users/tom/.asdf'...
remote: Enumerating objects: 8658, done.
remote: Counting objects: 100% (571/571), done.
remote: Compressing objects: 100% (371/371), done.
remote: Total 8658 (delta 260), reused 438 (delta 189), pack-reused 8087
Receiving objects: 100% (8658/8658), 2.89 MiB | 3.87 MiB/s, done.
Resolving deltas: 100% (5102/5102), done.
Then, update your ~/.zshrc
file to let OMZ know about the plugin.
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git asdf)
Install Python with ASDF
ASDF uses a plugin system, so we must add the Python plugin.
asdf plugin-add python
Then, install the specific version of Python you want.
asdf install python 3.11.0
Note: ASDF also allows you to install other versions at the same time
Like other version managers I’ve used for Ruby (irb, rbenv) you will need to tell your system to use the installed Python version.
asdf global python 3.11.0
asdf local python 3.11.0
which python
/Users/tom/.asdf/shims/python
which python3
/Users/tom/.asdf/shims/python3
python --version
Python 3.11.0
What is next?
In the next post, I’ll set up the project so we can start developing the service.