This topic explains how to install Snowflake CLI on supported platforms. Note that Snowflake CLI is not currently available for AIX systems.
Snowflake recommends using binary installation methods, such as package managers, to install Snowflake CLI on your system.
You can download the binary installers from the official Snowflake CLI repository.
要求
Before using Snowflake CLI, you must have a valid Snowflake account.
To run Streamlit in Snowflake using Snowflake CLI, you must have a Snowflake account with permission to use Streamlit.
To run Snowpark Container Services in Snowflake using Snowflake CLI, you must have a Snowflake account with privileges to use Snowpark Container Services.
Tip
If your Snowflake account requires MFA (multi-factor authentication), Snowflake CLI requires approval for every command. You can use MFA caching to require
authentication only once every four hours. For more information, see Use multi-factor authentication (MFA).
Usage: snow[OPTIONS]COMMAND[ARGS]...Snowflake CLI tool for developers.╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│--version Shows version of the Snowflake CLI ││--info Shows information about the Snowflake CLI ││--config-file FILE Specifies Snowflake CLI configuration file that should be used [default: None] ││--install-completion Install completion for the current shell. ││--show-completion Show completion for the current shell, to copy it or customize the installation. ││--help -h Show this message and exit. │╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ app Manages a Snowflake Native App ││connection Manages connectionstoSnowflake.││cortex Provides accesstoSnowflakeCortex.││git Manages git repositories inSnowflake.││notebook Manages notebooksinSnowflake.││object Manages Snowflakeobjectslikewarehousesandstages││snowpark Manages proceduresandfunctions.││ spcs Manages Snowpark Container Servicescomputepools,services,image registries,andimage repositories.││sql Executes Snowflake query.││stage Manages stages.││streamlit Manages a Streamlit app inSnowflake.│╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Run the installer and follow the instructions to install Snowflake CLI.
要验证软件是否安装成功,请打开新终端并运行以下命令:
snow --help
Usage: snow[OPTIONS]COMMAND[ARGS]...Snowflake CLI tool for developers.╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│--version Shows version of the Snowflake CLI ││--info Shows information about the Snowflake CLI ││--config-file FILE Specifies Snowflake CLI configuration file that should be used [default: None] ││--install-completion Install completion for the current shell. ││--show-completion Show completion for the current shell, to copy it or customize the installation. ││--help -h Show this message and exit. │╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ app Manages a Snowflake Native App ││connection Manages connectionstoSnowflake.││cortex Provides accesstoSnowflakeCortex.││git Manages git repositories inSnowflake.││notebook Manages notebooksinSnowflake.││object Manages Snowflakeobjectslikewarehousesandstages││snowpark Manages proceduresandfunctions.││ spcs Manages Snowpark Container Servicescomputepools,services,image registries,andimage repositories.││sql Executes Snowflake query.││stage Manages stages.││streamlit Manages a Streamlit app inSnowflake.│╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Run the installer and follow the instructions to install Snowflake CLI.
要验证软件是否安装成功,请打开新终端并运行以下命令:
snow --help
Usage: snow[OPTIONS]COMMAND[ARGS]...Snowflake CLI tool for developers.╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│--version Shows version of the Snowflake CLI ││--info Shows information about the Snowflake CLI ││--config-file FILE Specifies Snowflake CLI configuration file that should be used [default: None] ││--install-completion Install completion for the current shell. ││--show-completion Show completion for the current shell, to copy it or customize the installation. ││--help -h Show this message and exit. │╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ app Manages a Snowflake Native App ││connection Manages connectionstoSnowflake.││cortex Provides accesstoSnowflakeCortex.││git Manages git repositories inSnowflake.││notebook Manages notebooksinSnowflake.││object Manages Snowflakeobjectslikewarehousesandstages││snowpark Manages proceduresandfunctions.││ spcs Manages Snowpark Container Servicescomputepools,services,image registries,andimage repositories.││sql Executes Snowflake query.││stage Manages stages.││streamlit Manages a Streamlit app inSnowflake.│╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
To give Homebrew access to the Snowflake CLI repository, run the following command:
brew tap snowflakedb/snowflake-cli
brew update
To install Snowflake CLI, run the following command:
brew install snowflake-cli
要验证软件是否安装成功,请运行以下命令:
snow --help
Usage: snow[OPTIONS]COMMAND[ARGS]...Snowflake CLI tool for developers.╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│--version Shows version of the Snowflake CLI ││--info Shows information about the Snowflake CLI ││--config-file FILE Specifies Snowflake CLI configuration file that should be used [default: None] ││--install-completion Install completion for the current shell. ││--show-completion Show completion for the current shell, to copy it or customize the installation. ││--help -h Show this message and exit. │╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ app Manages a Snowflake Native App ││connection Manages connectionstoSnowflake.││cortex Provides accesstoSnowflakeCortex.││git Manages git repositories inSnowflake.││notebook Manages notebooksinSnowflake.││object Manages Snowflakeobjectslikewarehousesandstages││snowpark Manages proceduresandfunctions.││ spcs Manages Snowpark Container Servicescomputepools,services,image registries,andimage repositories.││sql Executes Snowflake query.││stage Manages stages.││streamlit Manages a Streamlit app inSnowflake.│╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
This method modifies the Python environment where you install Snowflake CLI. Consider using pipx instead to avoid dependency conflicts.
To install Snowflake CLI using pip, you must have Python (https://python.org) version 3.10 or later installed.
运行以下 shell 命令:
pip install snowflake-cli
要验证软件是否安装成功,请运行以下命令:
snow --help
Usage: snow[OPTIONS]COMMAND[ARGS]...Snowflake CLI tool for developers.╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│--version Shows version of the Snowflake CLI ││--info Shows information about the Snowflake CLI ││--config-file FILE Specifies Snowflake CLI configuration file that should be used [default: None] ││--install-completion Install completion for the current shell. ││--show-completion Show completion for the current shell, to copy it or customize the installation. ││--help -h Show this message and exit. │╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ app Manages a Snowflake Native App ││connection Manages connectionstoSnowflake.││cortex Provides accesstoSnowflakeCortex.││git Manages git repositories inSnowflake.││notebook Manages notebooksinSnowflake.││object Manages Snowflakeobjectslikewarehousesandstages││snowpark Manages proceduresandfunctions.││ spcs Manages Snowpark Container Servicescomputepools,services,image registries,andimage repositories.││sql Executes Snowflake query.││stage Manages stages.││streamlit Manages a Streamlit app inSnowflake.│╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
pipx (https://github.com/pypa/pipx) provides an alternative to pip that installs and executes Python packages into isolated virtual environments. Installing Snowflake CLI with pipx does not, therefore, modify your current Python environment.
Usage: snow[OPTIONS]COMMAND[ARGS]...Snowflake CLI tool for developers.╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│--version Shows version of the Snowflake CLI ││--info Shows information about the Snowflake CLI ││--config-file FILE Specifies Snowflake CLI configuration file that should be used [default: None] ││--install-completion Install completion for the current shell. ││--show-completion Show completion for the current shell, to copy it or customize the installation. ││--help -h Show this message and exit. │╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ app Manages a Snowflake Native App ││connection Manages connectionstoSnowflake.││cortex Provides accesstoSnowflakeCortex.││git Manages git repositories inSnowflake.││notebook Manages notebooksinSnowflake.││object Manages Snowflakeobjectslikewarehousesandstages││snowpark Manages proceduresandfunctions.││ spcs Manages Snowpark Container Servicescomputepools,services,image registries,andimage repositories.││sql Executes Snowflake query.││stage Manages stages.││streamlit Manages a Streamlit app inSnowflake.│╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Installing Snowflake CLI in FIPS-compliant environments¶
You can use a Docker image to install Snowflake CLI in an environment that is compliant with FIPS (Federal Information Processing Standards).
先决条件
Before installing Snowflake CLI in a FIPS-compliant environment, ensure that you meet the following prerequisites:
**FIPS 兼容 Python **:必须预先安装、构建和配置 Python,以保证 FIPS 合规性。这通常意味着 Python 与启用了 FIPS 的 OpenSSL 库相关联。
已启用 FIPS 的 OpenSSL:系统的 OpenSSL 库必须符合 FIPS 标准,并在运行时可供 Python 调用。
构建工具:必须提供标准构建工具(例如 C 编译器和 Python 开发头文件),因为依赖项将从源代码构建。
网络访问环境必须允许访问 PyPI 或内部软件包索引以下载源码分发包。
Install Snowflake CLI in a FIPS-compliant Dockerfile¶
To install Snowflake CLI in a FIPS-compliant environment, follow these steps:
在容器中创建 Python 虚拟环境,如以下示例所示:
python -m venv .venv
激活容器中的 Python 虚拟环境,如以下示例所示:
source ~/.venv/bin/activate
Upgrade pip and setuptools in the container, as shown in the following example:
pip install -U setuptools pip
Install the cryptography, Python connector, and Snowflake CLI dependencies from source in the container, as shown in the following example. Note that all dependencies must be installed from source to ensure they are built against your FIPS-compliant libraries.