These could be incomplete because I've had some of these installed for years. Would be curious if it works well on a fresh install.
Installing on macOS
Start by installing the Homebrew package manager. This can be done from the command line by pasting the supplied command into Terminal.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Once Homebrew is ready to go use the following command to install required packages:
$ brew install openssl swig luajit pyenv
Typically Python 2 is installed on the mac by default and brew doesn't do a great job installing Python 3. To setup and install Python 3 without interfering with the default install or having to do manual aliasing we'll use pyenv to manage the different versions.
(3.9.0 is the current version at the time of this writing)
After Python 3 is installed you'll need to switch to 3.9.0
Add the following to your .bash_profile or .zshrc configuration file depending on which shell you are using.
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
Reset terminal, or start a new terminal, and use which to verify that pyenv is working.
$ exec $0
$ which python
/Users/username/.pyenv/shims/python
$ python -V
Python 3.9.0
$ pip -V
pip 20.2.3 from /Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pip (python 3.9)
And finally, lets install m2crypto using the very long command below.
$ env LDFLAGS="-L$(brew --prefix openssl)/lib" \
CFLAGS="-I$(brew --prefix openssl)/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include" \
pip install m2crypto
These could be incomplete because I've had some of these installed for years. Would be curious if it works well on a fresh install.
Installing on macOS
Start by installing the Homebrew package manager. This can be done from the command line by pasting the supplied command into Terminal.
Once Homebrew is ready to go use the following command to install required packages:
Typically Python 2 is installed on the mac by default and brew doesn't do a great job installing Python 3. To setup and install Python 3 without interfering with the default install or having to do manual aliasing we'll use
pyenvto manage the different versions.(3.9.0 is the current version at the time of this writing)
After Python 3 is installed you'll need to switch to 3.9.0
Add the following to your
.bash_profileor.zshrcconfiguration file depending on which shell you are using.Reset terminal, or start a new terminal, and use
whichto verify thatpyenvis working.And finally, lets install
m2cryptousing the very long command below.