1. Environment variables are always in ~/. Bash_profile. After the system is updated recently, environment variables do not take effect after the terminal is restarted or the system is restarted.

$source ~/.bash_profile needs to be re-executed each time.

The zsh. bash_profile file is used to configure the global path in bash terminal

Solution: Solution 1: Add source ~/.bash_profile at the end of the ~/.zshrc file

Solution 2: Configure the global path in the. ZSHRC file

Scheme 3: Change the terminal to bash

Open the. ZSHRC file with two commands

touch .zshrc

open .zshrc