This xmlsec github issue on fixing pip install xmlsec
was really annoying to parse through. I pumped the contents into ChatGPT, which got me most of the way, and then I had to follow one of the other comments to get it working. I am documenting it here in case it helps someone else or if I need to reference it in the future.
-
Revert to libxmlsec1 v1.2.37:
-
Use Homebrew to uninstall the current version:
brew uninstall libxmlsec1
-
Download the previous version of the formula:
export DESIRED_SHA="7f35e6ede954326a10949891af2dba47bbe1fc17" wget -O /tmp/libxmlsec1.rb "https://raw.githubusercontent.com/Homebrew/homebrew-core/${DESIRED_SHA}/Formula/libxmlsec1.rb"
-
Edit the downloaded formula to ensure it uses
openssl@3
:vim /tmp/libxmlsec1.rb
Replace:
depends_on "[email protected]"
With:
depends_on "openssl@3"
-
There were new patch versions of libxmlsec1 released and the formula can't find the archive for 1.2.37 at the old URL. A quick fix is to edit the formula to point to the correct URL before installing it:
brew edit /tmp/libxmlsec1.rb
And update line 4 with the correct URL:
- url "https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.37.tar.gz" + url "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.37.tar.gz"
-
Install the edited formula:
brew install --formula /tmp/libxmlsec1.rb --build-from-source
-
-
Pin the version to prevent upgrades:
brew pin libxmlsec1
-
Install
xmlsec
: After completing the steps above, retry installingxmlsec
with pip:pip install xmlsec
If issues persist, ensure that Xcode and its command-line tools are installed and licensed:
xcode-select --install
sudo xcodebuild -license accept
This should address compatibility issues on Apple Silicon.