Не могу установить xmlsec для Mac

Я новичок в джанго. Я пытаюсь реализовать python3-saml, для которого требуется Xmlsec. я пытаюсь установить его, используя «pip install xmlsec» в моей виртуальной среде. но выдает эту ошибку.

          Collecting xmlsec
    Using cached xmlsec-1.3.12.tar.gz (64 kB)
    Installing build dependencies ... done
    Getting requirements to build wheel ... done
    Installing backend dependencies ... done
    Preparing metadata (pyproject.toml) ... done
    Requirement already satisfied: lxml>=3.8 in 
    /opt/anaconda3/envs/conda_saml_env/lib/python3.10/site-packages (from xmlsec) 
    (4.8.0)
    Building wheels for collected packages: xmlsec
    Building wheel for xmlsec (pyproject.toml) ... error
    error: subprocess-exited-with-error

    × Building wheel for xmlsec (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [14 lines of output]
  running bdist_wheel
  running build
  running build_py
  package init file 'src/xmlsec/__init__.py' not found (or not a regular file)
  creating build
  creating build/lib.macosx-10.9-x86_64-3.10
  creating build/lib.macosx-10.9-x86_64-3.10/xmlsec
  copying src/xmlsec/py.typed -> build/lib.macosx-10.9-x86_64-3.10/xmlsec
  copying src/xmlsec/tree.pyi -> build/lib.macosx-10.9-x86_64-3.10/xmlsec
  copying src/xmlsec/__init__.pyi -> build/lib.macosx-10.9-x86_64-3.10/xmlsec
  copying src/xmlsec/constants.pyi -> build/lib.macosx-10.9-x86_64-3.10/xmlsec
  copying src/xmlsec/template.pyi -> build/lib.macosx-10.9-x86_64-3.10/xmlsec
  running build_ext
  error: xmlsec1 is not installed or not in path.
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with 
pip.
 ERROR: Failed building wheel for xmlsec
 Failed to build xmlsec
 ERROR: Could not build wheels for xmlsec, which is required to install 
 pyproject.toml-based projects

Я попробовал следующее

  1. варить установить libxml2 libxmlsec1 pkg-config

Вывод для вышеуказанной команды

      Warning: libxml2 2.9.12 is already installed and up-to-date.
To reinstall 2.9.12, run:
   brew reinstall libxml2
Warning: libxmlsec1 1.2.33 is already installed and up-to-date.
To reinstall 1.2.33, run:
   brew reinstall libxmlsec1
Warning: pkg-config 0.29.2_3 is already installed and up-to-date.
To reinstall 0.29.2_3, run:
   brew reinstall pkg-config

У меня возникла такая же проблема, когда я попробовал ОС Linux. Затем я смог решить это, выполнив эту команду

      sudo apt-get install libxmlsec1-dev

Но я не могу запустить эту команду на своем Mac. Есть ли что-то, что мне не хватает.

1 ответ

Используйте эти команды:

      xcode-select --install
brew upgrade
brew install libxml2 libxmlsec1
pip install xmlsec
Другие вопросы по тегам