python - 在 Windows 中安装 Python-saml 包时出错

标签 python python-3.x anaconda single-sign-on saml

我想使用 python-saml 与 Flask Web 应用程序进行 sso 集成。当我尝试使用 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 channel 或 PYPI 提供此软件包?

最佳答案

更新
从 1.3.7 版开始,预制轮子 xmlsec Windows 版已在 PyPI 上发布,因此您不应再遇到此问题。
原答案
我已经重建xmlsec windows 轮子并将它们上传到 releases page of my fork .要安装,首先安装 xmlsec传递额外的 PyPI 索引:

$ pip install xmlsec --extra-index-url=https://hoefling.io/pypi
添加的索引只是代理对 Github 版本的安装请求。
现在安装 python3-saml :
$ pip install python3-saml
(替代)手动选择 dist
您可以从 releases page 手动找到与您的 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通过调用测试工作
我已经对所有构建的轮子执行了测试(查看 this job log on Appveyor ),但您也可以在本地运行测试以验证 xmlsec安装工作:
$ git clone https://github.com/mehcode/python-xmlsec.git && cd python-xmlsec
$ pip install pytest
$ pytest tests/

关于python - 在 Windows 中安装 Python-saml 包时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61362492/

相关文章:

python - 在Python中,有没有好的 "magic method"来表示对象相似度呢?

python - 在numpy中用3d数组索引2d数组

python - 在python中通过继承创建自定义float类

windows - "conda: command not found",Windows 上的 Bash

python - 无法将 gdal 导入使用 anaconda (MacOSX) 安装的 python

Python - 计算所有对的总和

Python sqlite3 参数化掉表

Python:我错过了什么吗?

python-3.x - 如何使用 tkinter.Label 更改文本颜色

python-3.x - Scikit-Learn 中的神经网络未产生有意义的结果