responder でアプリケーションを書いても AttributeError: module 'typesystem' has no attribute 'SchemaDefinitions'
というエラーになる場合があります。 例えば以下のように pip で gunicorn や responder をインストールせずにインストールし、アプリケーションを実行した場合にエラーになるかも知れません。
mkdir /opt/hello
cd /opt/hello
python3 -m venv .venv
echo 'source .venv/bin/activate' > .envrc
direnv allow
python3 -m pip install --upgrade pip gunicorn responder
Version 0.3.0 の commit を見ると SchemaDefinitions
から Definitions
という名前に変更されたように見えます。 このエラーを避ける為には以下のように typesystem のバージョンを 変更前 の 0.2.5 に固定してインストールすることで回避出来ます。
python3 -m pip install --upgrade pip gunicorn responder typesystem==0.2.5
もしくは下記のように requirements.txt
を用意し、そちらからインストールする方法もあります。
cat << 'EOF' > requirements.txt
gunicorn
responder
typesystem==0.2.5
EOF
python3 -m pip install -r requirements.txt
コメント