pythonz icon indicating copy to clipboard operation
pythonz copied to clipboard

Python 3.7 Mac needs a different way to compile with ssl

Open nedbat opened this issue 7 years ago • 7 comments

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 avatar Jun 12 '18 21:06 nedbat

@nedbat try --configure=CONFIGURE_OPTIONS

ifduyue avatar Jun 30 '18 18:06 ifduyue

Nice! This worked:

pythonz install 3.7.0 --configure="--with-pydebug --with-openssl=$(brew --prefix openssl)"

nedbat avatar Jun 30 '18 19:06 nedbat

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

miozus avatar Jan 01 '19 06:01 miozus

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
}

jpstroop avatar Jan 04 '20 14:01 jpstroop

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 avatar Jun 09 '22 09:06 izumiberat

@izumiberat did you try pythonz install 3.10.4 --configure="--with-pydebug --with-openssl=$(brew --prefix openssl)"

ifduyue avatar Jun 09 '22 14:06 ifduyue

Thank you for your help @ifduyue, running the command in the cpython directory resolved the issue.

izumiberat avatar Jun 09 '22 15:06 izumiberat