首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >当pip安装xmlsec时,接收“错误: xmlsec1未安装或不在路径”。

当pip安装xmlsec时,接收“错误: xmlsec1未安装或不在路径”。
EN

Stack Overflow用户
提问于 2021-05-13 03:46:49
回答 2查看 3.1K关注 0票数 8

我正在使用MacOS 10.15.7 Catalina,目前正在使用Python3.8.4和Pip21.1.1。

无论出于什么原因,当我试图运行python -m pip install xmlsec时,我总是会收到一个错误

文本格式错误:

代码语言:javascript
运行
复制
➜ python -m pip install xmlsec 
Collecting xmlsec
  Using cached xmlsec-1.3.10.tar.gz (62 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Requirement already satisfied: lxml>=3.8 in /Users/rsheikh/.pyenv/versions/3.8.4/lib/python3.8/site-packages (from xmlsec) (4.6.3)
Building wheels for collected packages: xmlsec
  Building wheel for xmlsec (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/rsheikh/.pyenv/versions/3.8.4/bin/python /Users/rsheikh/.pyenv/versions/3.8.4/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/q6/l4q1yvg11v3dftcbdqr8jxgh0000gq/T/tmp6b9bs29g
       cwd: /private/var/folders/q6/l4q1yvg11v3dftcbdqr8jxgh0000gq/T/pip-install-re_pqhol/xmlsec_f862b9f5baae4fe49f2ba58dadb464f1
  Complete output (20 lines):
  running bdist_wheel
  running build
  running build_py
  /private/var/folders/q6/l4q1yvg11v3dftcbdqr8jxgh0000gq/T/pip-build-env-dqtkuueu/overlay/lib/python3.8/site-packages/setuptools/dist.py:648: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
    warnings.warn(
  /private/var/folders/q6/l4q1yvg11v3dftcbdqr8jxgh0000gq/T/pip-build-env-dqtkuueu/overlay/lib/python3.8/site-packages/setuptools/dist.py:648: UserWarning: Usage of dash-separated 'build-requires' will not be supported in future versions. Please use the underscore name 'build_requires' instead
    warnings.warn(
  /private/var/folders/q6/l4q1yvg11v3dftcbdqr8jxgh0000gq/T/pip-build-env-dqtkuueu/overlay/lib/python3.8/site-packages/setuptools/dist.py:648: UserWarning: Usage of dash-separated 'upload-dir' will not be supported in future versions. Please use the underscore name 'upload_dir' instead
    warnings.warn(
  package init file 'src/xmlsec/__init__.py' not found (or not a regular file)
  creating build
  creating build/lib.macosx-10.15-x86_64-3.8
  creating build/lib.macosx-10.15-x86_64-3.8/xmlsec
  copying src/xmlsec/py.typed -> build/lib.macosx-10.15-x86_64-3.8/xmlsec
  copying src/xmlsec/tree.pyi -> build/lib.macosx-10.15-x86_64-3.8/xmlsec
  copying src/xmlsec/__init__.pyi -> build/lib.macosx-10.15-x86_64-3.8/xmlsec
  copying src/xmlsec/constants.pyi -> build/lib.macosx-10.15-x86_64-3.8/xmlsec
  copying src/xmlsec/template.pyi -> build/lib.macosx-10.15-x86_64-3.8/xmlsec
  running build_ext
  error: xmlsec1 is not installed or not in path.
  ----------------------------------------
  ERROR: Failed building wheel for xmlsec
Failed to build xmlsec
ERROR: Could not build wheels for xmlsec which use PEP 517 and cannot be installed directly

但是,我验证了xmlsec1是与xmlsec1 --version一起安装的,后者返回:xmlsec1 1.2.32 (openssl)

到目前为止,我用自制软件安装了pkg-config 0.29.2_3Libxmlsec1 1.2.32libxml2 2.9.10_2

我还向我的Libxmlsec1添加了必要的openssl 1.1导出和openssl 1.1导出。

是否有一个额外的参数,我需要添加到我的zsh路径,以使这个pip安装正常工作,我错过了?

EN

回答 2

Stack Overflow用户

发布于 2022-06-28 21:21:20

这个错误令人困惑。它似乎需要开发库。

代码语言:javascript
运行
复制
sudo apt install libxmlsec1 libxmlsec1-dev

(如果仍然失败,请尝试Almenon的回答)

票数 3
EN

Stack Overflow用户

发布于 2022-04-01 22:40:16

我在Ubuntu上遇到了同样的问题。我认为问题在于brew的pkg-config正在被使用,而不是我通过apt安装的pkg-config。要修复它,请将PKG_CONFIG_PATH更改为指向PKG_CONFIG_PATH。

对我来说,这是下面的命令,但如果您在mac上,则可能会有所不同。

export PKG_CONFIG_PATH=/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

然后运行pip安装和享受。

也不确定这是否有区别,但我通过apt安装了Libxmlsec1。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67513629

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档