1、基础环境配置MAC版安装brew安装地址https://docs.brew.sh/Installation安装命令#官网原版 /bin/bash -c $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) #国内镜像 /bin/zsh -c $(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)安装pyenv安装地址https://github.com/pyenv/pyenv#installationbrew install pyenv安装pythonpyenv install 3.10.4安装后确认python3 --version2、引入python图形化包并编码运行#推荐先创建虚拟环境python -m venv venvsource venv/bin/activatepip install gradio国内加速pip install gradio -i https://mirrors.baidu.com/pypi/simple/import gradio as gr def greet(name): return fHello, {name}! demo gr.Interface(fngreet, inputstext, outputstext) demo.launch()