サーバーレスのイベント駆動型Pythonアプリを構築及びデプロイできる「Zappa」のインストール

サーバーレスのイベント駆動型Pythonアプリを構築及びデプロイできる「Zappa」のインストールについて解説しています。

「Zappa(https://github.com/zappa/Zappa)」は、サーバーレスのイベント駆動型PythonアプリをAWS Lambda + API Gatewayを用いて簡単に構築及びデプロイできます。

■Python

今回のPythonのバージョンは、「3.8.5」を使用しています。(Windows10)(pythonランチャーでの確認)

■Zappaをインストールする

Zappaをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。

pip install zappa

起動後、上記のコマンドを入力し、Enterキーを押します。

なお、今回は、pythonランチャーを使用しており、Python Version 3.8.5にインストールを行うために、バージョンの切り替えを行います。

py -3.8 -m pip install zappa

切り替えるために、上記のコマンドを入力し、Enterキーを押します。

Defaulting to user installation because normal site-packages is not writeable
Collecting zappa
Downloading zappa-0.54.1-py3-none-any.whl (116 kB)
---------------------------------------- 116.7/116.7 kB 1.4 MB/s eta 0:00:00
Collecting troposphere>=3.0
Downloading troposphere-4.0.2-py3-none-any.whl (387 kB)
---------------------------------------- 387.4/387.4 kB 2.2 MB/s eta 0:00:00
Requirement already satisfied: jmespath in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (0.10.0)
Requirement already satisfied: boto3>=1.17.28 in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (1.21.31)
Requirement already satisfied: six in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (1.16.0)
Requirement already satisfied: werkzeug in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (2.0.1)
Collecting placebo<0.10
Downloading placebo-0.9.0.tar.gz (13 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: pyyaml in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (6.0)
Requirement already satisfied: pip>=9.0.1 in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (22.1)
Requirement already satisfied: python-dateutil in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (2.8.2)
Collecting argcomplete
Downloading argcomplete-2.0.0-py2.py3-none-any.whl (37 kB)
Requirement already satisfied: requests>=2.20.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (2.27.1)
Requirement already satisfied: wheel in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (0.37.1)
Collecting kappa==0.6.0
Downloading kappa-0.6.0.tar.gz (29 kB)
Preparing metadata (setup.py) ... done
Collecting hjson
Downloading hjson-3.0.2-py3-none-any.whl (54 kB)
---------------------------------------- 54.2/54.2 kB 1.4 MB/s eta 0:00:00
Collecting wsgi-request-logger
Downloading wsgi-request-logger-0.4.6.tar.gz (4.4 kB)
Preparing metadata (setup.py) ... done
Collecting durationpy
Downloading durationpy-0.5.tar.gz (1.7 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: future in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (0.18.2)
Requirement already satisfied: python-slugify in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (4.0.1)
Requirement already satisfied: toml in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (0.10.2)
Requirement already satisfied: tqdm in c:\users\user_\appdata\roaming\python\python38\site-packages (from zappa) (4.60.0)
Requirement already satisfied: click>=5.1 in c:\users\user_\appdata\roaming\python\python38\site-packages (from kappa==0.6.0->zappa) (8.0.4)
Requirement already satisfied: botocore<1.25.0,>=1.24.31 in c:\users\user_\appdata\roaming\python\python38\site-packages (from boto3>=1.17.28->zappa) (1.24.31)
Requirement already satisfied: s3transfer<0.6.0,>=0.5.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from boto3>=1.17.28->zappa) (0.5.2)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests>=2.20.0->zappa) (1.26.9)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests>=2.20.0->zappa) (2.0.12)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests>=2.20.0->zappa) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests>=2.20.0->zappa) (3.3)
Collecting cfn-flip>=1.0.2
Downloading cfn_flip-1.3.0-py3-none-any.whl (21 kB)
Requirement already satisfied: text-unidecode>=1.3 in c:\users\user_\appdata\roaming\python\python38\site-packages (from python-slugify->zappa) (1.3)
Requirement already satisfied: colorama in c:\users\user_\appdata\roaming\python\python38\site-packages (from click>=5.1->kappa==0.6.0->zappa) (0.4.4)
Building wheels for collected packages: kappa, placebo, durationpy, wsgi-request-logger
Building wheel for kappa (setup.py) ... done
Created wheel for kappa: filename=kappa-0.6.0-py3-none-any.whl size=34719 sha256=9ebf0363f2754254a87301766ab3941feb4fa39e58a1d8438d2e7e3ff72926ba
Stored in directory: c:\users\user_\appdata\local\pip\cache\wheels\a4ad81f6b6ca3978c9fd4309956b5eebd8ada33935202db46a
Building wheel for placebo (setup.py) ... done
Created wheel for placebo: filename=placebo-0.9.0-py3-none-any.whl size=14795 sha256=38023871129906ba4c0335ca052e5140f11726568031722914bbe07143b918f2
Stored in directory: c:\users\user_\appdata\local\pip\cache\wheels\a4\f1934c8ef89815b46f0128bf35c34bfcdebc638ce73b2bbbdd
Building wheel for durationpy (setup.py) ... done
Created wheel for durationpy: filename=durationpy-0.5-py3-none-any.whl size=2498 sha256=d66027b207dcb3c3d05dd9705dba67bafa94b0e4d8ad97a6d5b4a2ec6f926c96
Stored in directory: c:\users\user_\appdata\local\pip\cache\wheels\ddd1a797deac1a392c51d8ac102746af685f7d21e6e466502ca
Building wheel for wsgi-request-logger (setup.py) ... done
Created wheel for wsgi-request-logger: filename=wsgi_request_logger-0.4.6-py3-none-any.whl size=4198 sha256=50172573c8badf0f37a07e0d68acf5e7743254f7d12c4678fc909b21bf566831
Stored in directory: c:\users\user_\appdata\local\pip\cache\wheels\f7\fa\e13906a2b820209f9f9367e900e499d464f7e73bb8c9598254
Successfully built kappa placebo durationpy wsgi-request-logger
Installing collected packages: wsgi-request-logger, placebo, hjson, durationpy, argcomplete, cfn-flip, troposphere, kappa, zappa
Successfully installed argcomplete-2.0.0 cfn-flip-1.3.0 durationpy-0.5 hjson-3.0.2 kappa-0.6.0 placebo-0.9.0 troposphere-4.0.2 wsgi-request-logger-0.4.6 zappa-0.54.1

Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、zappaが正常にインストールされたことになります。

なお、今回はzappaのバージョン0.54.1をインストールしました。

コメント

タイトルとURLをコピーしました