web-dev-qa-db-ja.com

WindowsにPython-samlパッケージをインストールする際のエラー

flask Webアプリとのsso統合にpython-samlを使用したいのですが、pip install python-samlを使用してpython-samlパッケージをインストールしようとすると、次のエラーメッセージが表示されます。

(myvenv) C:\Users\sekar>pip install python3-saml==1.9.0
Collecting python3-saml==1.9.0
  Using cached python3_saml-1.9.0-py3-none-any.whl (72 kB)
Collecting xmlsec>=0.6.0
  Using cached xmlsec-1.3.3.tar.gz (29 kB)
Building wheels for collected packages: xmlsec
  Building wheel for xmlsec (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\setup.py'"'"'; __file__='"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\sekar\AppData\Local\Temp\16\pip-wheel-39e4ydgb'
       cwd: C:\Users\sekar\AppData\Local\Temp\16\pip-install-9x0le85b\xmlsec\
  Complete output (5 lines):
  running bdist_wheel
  running build
  running build_ext
  error: HTTP Error 404: The specified blob does not exist.
  Retrieving "https://ci.appveyor.com/api/buildjobs/hij3a6776pdv2007/artifacts/libxml2-2.9.4.win64.Zip" to "build/extra\libxml2-2.9.4.win64.Zip"
  ----------------------------------------
  ERROR: Failed building wheel for xmlsec
  Running setup.py clean for xmlsec
Failed to build xmlsec
Installing collected packages: xmlsec, python3-saml
    Running setup.py install for xmlsec ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\setup.py'"'"'; __file__='"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\sekar\AppData\Local\Temp\16\pip-record-l_q25m6k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\Include\xmlsec'
         cwd: C:\Users\sekar\AppData\Local\Temp\16\pip-install-9x0le85b\xmlsec\
    Complete output (5 lines):
    running install
    running build
    running build_ext
    error: HTTP Error 404: The specified blob does not exist.
    Retrieving "https://ci.appveyor.com/api/buildjobs/hij3a6776pdv2007/artifacts/libxml2-2.9.4.win64.Zip" to "build/extra\libxml2-2.9.4.win64.Zip"
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\setup.py'"'"'; __file__='"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\sekar\AppData\Local\Temp\16\pip-record-l_q25m6k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\Include\xmlsec' Check the logs for full command output.

私はconda install python-samlで試しましたが、同じエラーで2年前にこのパッケージが停止しました。私も試しましたpython3-saml

コアの問題はxmlsecパッケージにあります。

このパッケージを提供するcondaチャネルまたはPYPIはありますか?

6

私はxmlsec Windowsホイールを再構築し、それらを 私のフォークのリリースページ にアップロードしました。インストールするには、最初にxmlsecをインストールし、追加のPyPIインデックスを渡します。

$ pip install xmlsec --extra-index-url=https://hoefling.io/pypi

追加されたインデックスは、Githubリリースへのインストールリクエストのプロキシです。

python3-samlをインストールします。

$ pip install python3-saml

(代替)distを手動で選択する

Pythonインストールから リリースページ に一致するホイールを手動で見つけて、直接リンクを使用してインストールできます。

$ python -c "from pip._internal.pep425tags import get_supported; print(*get_supported()[0], sep='-')"
cp37-cp37m-win_AMD64
# the matching wheel is thus xmlsec-1.3.6.post1-cp37-cp37m-win_AMD64.whl
$ pip install https://github.com/hoefling/xmlsec/releases/download/1.3.6.post1/xmlsec-1.3.6.post1-cp37-cp37m-win_AMD64.whl

(オプション)テストを呼び出してxmlsecが機能することを確認します

私はすべてのビルドされたホイールに対してテストを実行しました(チェックアウト Appveyorのこのジョブログ )ですが、ローカルでテストを実行して、xmlsecインストールが機能していることを確認することもできます。

$ git clone https://github.com/mehcode/python-xmlsec.git && cd python-xmlsec
$ pip install pytest
$ pytest tests/
2
hoefling

ここでpython-samlを使用したことはありません...ただし、このエラーを検索しているときに、GitHubに次の問題が見つかりました: Issue 1 および Issue 2

どちらもdm.xmlsec.bindingの問題について話します。

ベスト、
フェリペ