Choose either Python or Go and build your local environment.
- If your local version is below Python3.8, install Python3.10.
- If you have Python3.8 or above, you can skip the installation step.
- Check if the Python is added to your PATH (usable as commands on your terminal) with the following command.
$ python -V
If the version does not correspond to the Python version you installed, double check your installation as it is not added to your PATH.
📖 Reference
The list of dependent libraries is written in a file called requirements.txt
in a typical Python project.
You can install the dependencies by running the following command.
$ cd python
# Create virtual environment for this application
$ python -m venv .venv
$ source .venv/bin/activate
# When you use non-UNIX os, the activation method is different.
# Install required library
$ pip install -r requirements.txt
If you added a library, make sure you add it to requirements.txt
.
python -m venv .venv
is a command to create a Python virtual environment.
A virtual environment is a way to create a project-specific Python environment.
Using a virtual environment allows you to manage necessary packages separately for each project so that you can avoid dependency conflicts between different projects.
Once the virtual environment is created, it must be activated by the source .venv/bin/activate
command.
- venv — Creation of virtual environments
- Install packages in a virtual environment using pip and venv
$ uvicorn main:app --reload --port 9000
If successful, you can access the local host http://127.0.0.1:9000
on our browser and you will see{"message": "Hello, world!"}
.
- If your local version is below Go1.20, install Go1.21.
- If you have Go1.20 or above, you can skip the installation step.
Download it from this link!
※ If you are using a Mac and are unsure whether to download the x86-64
or ARM64
version, click on the Apple logo at the top left corner > select "About This Mac". If the chip is listed as "Apple" choose ARM64
; if it's "Intel" select x86-64
.
- Check if Go is added to your PATH (usable as commands on your terminal) with the following command.
$ go version
If the version does not correspond to the Python version you installed, double check your installation as it is not added to your PATH.
📖 Reference
Recommendation web page about Go
- A Tour of Go
- Go: The Complete Developer's Guide (Golang)
- Section11 is closely related to the content of this training and is particularly recommended as a reference.
In Go, dependent libraries are managed in a file called go.mod
.
You can install the dependencies by running the following command.
$ cd go
$ go mod tidy
🔰 Point
Understand the role of go.mod
and the commands around it referring to this document.
$ go run app/main.go
If successful, you can access the local host http://127.0.0.1:9000
on our browser and you will see{"message": "Hello, world!"}
.
🔰 Points
- If you're using Linux or Mac, understand when and how
.bash_profile
and.bashrc
are activated and used (or.zshrc
if you're using zsh). - Understand what it means to add to PATH.
📖 Reference
The following resources are useful to dive deeper into building environments and Linux.
-
(JA)Udemy Business - もう絶対に忘れない Linux コマンド【Linux 100本ノック+名前の由来+丁寧な解説で、長期記憶に焼き付けろ!
- ↑わかりやすい講座だと思い貼ってますが、コマンドの暗記は特にしなくていいです
-
(EN)Udemy Business - Linux Mastery: Master the Linux Command Line in 11.5 Hours
- You do NOT have to memorize the commands!