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-3.x - 模块 'cv2.cv2' 没有属性 'sift'

python - Barebones SWIG python C 接口(interface)在 OSX+clang 上出现段错误,而不是在 Linux+gcc 中

python - 如何在 cython 中实现更好的循环速度性能?

python - 如何修复Python中的 "' str'对象不支持项目分配?

python - 当外部模块已经导入到其他导入模块中时,是否必须重新导入外部模块?

python - 我可以让 Anaconda 导航器查看 pypi 上的包吗?

python - 如何使用 Anaconda 从 Windows 中的任何目录运行项目文件

python - pybluez 未检测到任何设备

python - 将两个变量添加到 QComboBox

python - 如何在python中初始化一个集合并打印一个空集合{}?