0

I'm looking to install the 2.6.6 Python as 32-bit with pyenv on OS X, but get:

ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Despite having consulted Common Build Problems, and applying the flags suggested there, as well as installing Xcode developer tools, the problem persists. Here is the full command:

CFLAGS="-I$(xcrun --show-sdk-path)/usr/include -arch i386 -I$(brew --prefix openssl)/include" LDFLAGS="-arch i386 -L$(brew --prefix openssl)/lib" CONFIGURE_OPTS="--with-arch=i386" pyenv install 2.6.6

... but this builds the 64-bit build, which is not what I need.

Oddly, the build works when just the following is tried:

CFLAGS="-I$(brew --prefix openssl)/include" LDFLAGS="-L$(brew --prefix openssl)/lib" pyenv install 2.6.6

What are we missing? Does the following from the log imply that I need an openssl which was built for i386 / 32-bit?

ld: warning: ignoring file /usr/local/opt/openssl/lib/libcrypto.dylib, file   
was built for x86_64 which is not the architecture being linked (i386):   
/usr/local/opt/openssl/lib/libcrypto.dylibld: warning: 
ignoring file /usr/local/opt/openssl/lib/libssl.dylib, file was built for 
x86_64 which is not the architecture being linked (i386): 
/usr/local/opt/openssl/lib/libssl.dylib
Martin Konecny
  • 57,827
  • 19
  • 139
  • 159
Pyderman
  • 14,809
  • 13
  • 61
  • 106
  • 1
    The error message says exactly that. Why do you want the 32-bit version of Python? – Martin Konecny Jan 16 '16 at 21:59
  • Long story that is not pertinent, but if you must know, it's to allow for a very old wxPython that only works on 32-bit. – Pyderman Jan 16 '16 at 22:00
  • 1
    Try building the 32-bit version using these instructions: http://foodpicky.com/?p=99. The key appears to be using `darwin-i386-cc` when building. – Martin Konecny Jan 16 '16 at 22:04
  • OK. Would this achieve the same as what is suggested here: http://stackoverflow.com/a/4089574/1389110 ? And then, whatever method I use, how do I make sure that the pyenv build process uses the newly-built 32-bit install, rather than my *brew* install, which it seems to be currently doing? – Pyderman Jan 16 '16 at 22:10
  • 1
    Once you finish building, you will have a `python` binary somewhere in your build directory. You just need to point pyenv to that. And yes, those instructions look good. – Martin Konecny Jan 16 '16 at 22:12
  • So I built using Ned Deily's approach, resulting in in /tmp/openssl-1.0.0a. I then surmised that if I created the following symlink: `sudo ln -s /tmp/openssl-1.0.0a /usr/local/opt/openssl` then the build would pick up this 32-bit openssl, but it continues to warn about: `warning: ignoring file /usr/local/opt/openssl/lib/libcrypto.dylib` so I guess something is amiss. – Pyderman Jan 16 '16 at 22:49
  • Replace `-L$(brew --prefix openssl)/lib"` with `-L/tmp/openssl-1.0.0a/lib"` Make sure that path exists first (`lib` may be in a deeper subdir). – Martin Konecny Jan 16 '16 at 22:52
  • Do it for `-I$(brew --prefix openssl)/include` as well. – Martin Konecny Jan 16 '16 at 22:52

0 Answers0