pythonz
pythonz copied to clipboard
Python 3.7 Mac needs a different way to compile with ssl
I've found pythonz can't build 3.7 with ssl on Mac successfully.
The devguide (https://devguide.python.org/setup/) says:
with Homebrew:
$ brew install openssl xz
and configure python versions >= 3.7:
./configure --with-pydebug --with-openssl=$(brew --prefix openssl)
or configure python versions < 3.7:
$ CPPFLAGS="-I$(brew --prefix openssl)/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
./configure --with-pydebug
@nedbat try --configure=CONFIGURE_OPTIONS
Nice! This worked:
pythonz install 3.7.0 --configure="--with-pydebug --with-openssl=$(brew --prefix openssl)"
Nice! this worked too
--configure="--with-pydebug --with-openssl=$(brew --prefix openssl)"
make
sudo make install
pip install ipython --user
via Python 3.7.2
In case it helps anyone else: This always gets me, and I finally added a function in my .bash_profile that always adds these args:
function pythonz() {
EXTRA_INSTALL_FLAGS="--with-pydebug --with-openssl=$(brew --prefix openssl)"
if [[ "$1" == "install" ]]; then
shift 1
command pythonz install $1 --configure="$EXTRA_INSTALL_FLAGS"
else
command pythonz "$@"
fi
}
Hi, I installed Python 3.10.4 on MacOS Catalina 10.15.7.
I am following the same instructions as indicated in this issue and I get the following error when executing :
./configure --with-pydebug --with-openssl=$(brew --prefix openssl)
Result :
zsh: no such file or directory: ./configure
It tries to look for that file here : /usr/local/opt/openssl@3 Should I simply create a file named "configure"? I tried the suggested commands too, but I get a similar error message. Thanks for your help.
@izumiberat did you try pythonz install 3.10.4 --configure="--with-pydebug --with-openssl=$(brew --prefix openssl)"
Thank you for your help @ifduyue, running the command in the cpython directory resolved the issue.