5

Tried to install python 3.5.10 using the below command,

LDFLAGS="-L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib" arch -x86_64 pyenv install --patch 3.5.10 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)

Error

python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.5.10.tar.xz...
-> https://www.python.org/ftp/python/3.5.10/Python-3.5.10.tar.xz
Installing Python-3.5.10...
patching file Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst
patching file configure
Hunk #1 succeeded at 3492 (offset 66 lines).
patching file configure.ac
Hunk #1 succeeded at 492 (offset -18 lines).
python-build: use tcl-tk from $PYTHON_CONFIGURE_OPTS
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems


BUILD FAILED (OS X 12.0 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/cp/9vd_jfnx6nxbwyrtglh4ck8m0000gp/T/python-build.20211224162242.50602
Results logged to /var/folders/cp/9vd_jfnx6nxbwyrtglh4ck8m0000gp/T/python-build.20211224162242.50602.log

Last 10 log lines:
(cd /Users/bshyamprasath/.pyenv/versions/3.5.10/share/man/man1; ln -s python3.5.1 python3.1)
if test "xupgrade" != "xno"  ; then \
        case upgrade in \
            upgrade) ensurepip="--upgrade" ;; \
            install|*) ensurepip="" ;; \
        esac; \
         ./python.exe -E -m ensurepip \
            $ensurepip --root=/ ; \
    fi
Ignoring ensurepip failure: pip 9.0.1 requires SSL/TLS

I tried several combinations as mentioned in this Issue thread . But it is always resulting in the above error.

.zshrc file

PYTHON_CONFIGURE_OPTS="--with-tcltk-includes='-I$HOMEBREW_PREFIX/opt/tcl-tk/include'"
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-tcltk-libs='-L$HOMEBREW_PREFIX/opt/tcl-tk/lib -ltcl8.6 -ltk8.6'"
export CFLAGS="-O2 -I$HOMEBREW_PREFIX/include"
CPPFLAGS="-I$HOMEBREW_PREFIX/opt/sqlite/include -I$HOMEBREW_PREFIX/opt/tcl-tk/include"
CPPFLAGS="$CPPFLAGS -I$HOMEBREW_PREFIX/opt/zlib/include"
CPPFLAGS="$CPPFLAGS -I$HOMEBREW_PREFIX/opt/bzip2/include"
export CPPFLAGS="$CPPFLAGS -I$HOMEBREW_PREFIX/opt/openssl@1.1/include"
LDFLAGS="-L$HOMEBREW_PREFIX/opt/sqlite/lib -L$HOMEBREW_PREFIX/opt/tcl-tk/lib"
LDFLAGS="$LDFLAGS -L$HOMEBREW_PREFIX/opt/zlib/lib"
LDFLAGS="$LDFLAGS -L$HOMEBREW_PREFIX/opt/bzip2/lib"
export LDFLAGS="$LDFLAGS -L$HOMEBREW_PREFIX/opt/openssl@1.1/lib -L$HOMEBREW_PREFIX/opt/readline/lib"
PKG_CONFIG_PATH="$HOMEBREW_PREFIX/opt/sqlite/lib/pkgconfig:$HOMEBREW_PREFIX/opt/tcl-tk/lib/pkgconfig"
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_PREFIX/opt/zlib/lib/pkgconfig"
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_PREFIX/opt/bzip2/lib/pkgconfig"
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_PREFIX/opt/openssl@1.1/lib/pkgconfig"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PYENV_ROOT/versions/$PYENV_VERSION/lib/pkgconfig"


VIRTUALENVWRAPPER_PYTHON=/opt/homebrew/bin/python3
source /opt/homebrew/bin/virtualenvwrapper.sh
WORKON_HOME=$HOME/.virtualenvs
source $(brew --prefix nvm)/nvm.sh

eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Shyam
  • 5,292
  • 1
  • 10
  • 20
  • 1
    Python 3.5 is seriously outdated (Python 3. **6** just went EOL this week). Why do you try and assume it can be installed on a rather new Apple M1 in the first place? – MisterMiyagi Dec 24 '21 at 11:28
  • @MisterMiyagi It is part of the dev setup in my project , so I don't have much of an option here . – Shyam Dec 24 '21 at 11:42
  • 2
    "ERROR: The Python ssl extension was not compiled." -- that's the error I see, have you investigated why that failed? – Ulrich Eckhardt Dec 24 '21 at 14:31
  • Have you ran into a specific issue using a higher version of Python3 that explicitly requires 3.5? – OneCricketeer Dec 31 '21 at 07:49

1 Answers1

-1

Installing below specific version might resolve the issue.

pyenv install 3.5.10

Jay Modi
  • 3,161
  • 4
  • 35
  • 52
RSale
  • 463
  • 5
  • 14