選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

步驟 1:準備您的環境以執行指令碼

焦點模式
步驟 1:準備您的環境以執行指令碼 - AWS OpsWorks

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

為您的作業系統執行適當的命令,以準備您的環境。

Amazon Linux 2

sudo su python3 -m pip install pipenv PATH="$PATH:/usr/local/bin" yum update yum install git

Amazon Linux

sudo su PATH="$PATH:/usr/local/bin" export LC_ALL=en_US.utf-8 export LANG=en_US.utf-8 yum update yum list | grep python3 yum install python36 // Any python version yum install git

對於 Python 3.6 版, 也會執行:

python3 -m pip install pipenv==2022.4.8

對於 Python 3.7 版和更新版本,也執行:

python3 -m pip install pipenv

Ubuntu 18.04、20.04、22.04

sudo su export PATH="${HOME}/.local/bin:$PATH" apt-get update apt install python3-pip apt-get install git // if git is not installed python3 -m pip install --user pipenv==2022.4.8

Red Hat Enterprise Linux 8

sudo su sudo dnf install python3 PATH="$PATH:/usr/local/bin" yum update yum install git python3 -m pip install pipenv==2022.4.8

Windows Server 2019、Windows 10 企業版

注意

針對 Windows Server 2019,安裝 Python 3.6.1 版或更新版本。

pip install pipenv

如果尚未安裝 Git,請下載並安裝 Git

如果您使用 Git 做為技術指南來源,請在 Windows 上執行指令碼之前,將 Git 伺服器新增至 known_hosts 檔案。您可以使用 PowerShell 建立下列函數。

function add_to_known_hosts($server){ $new_host=$(ssh-keyscan $server 2> $null) $existing_hosts='' if (!(test-path "$env:userprofile\.ssh")) { md "$env:userprofile\.ssh" } if ((test-path "$env:userprofile\.ssh\known_hosts")) { $existing_hosts=Get-Content "$env:userprofile\.ssh\known_hosts" } $host_added=0 foreach ($line in $new_host) { if (!($existing_hosts -contains $line)) { Add-Content -Path "$env:userprofile\.ssh\known_hosts" -Value $line $host_added=1 } } if ($host_added) { echo "$server has been added to known_hosts." } else { echo "$server already exists in known_hosts." } }

然後,您可以在執行函數時提供 Git 伺服器 (例如 github.com、git-codecommit.repository_region.amazonaws.com)。

add_to_known_hosts "myGitServer"
隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。