Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile on El Capitan #448

Closed
alanorth opened this issue Sep 27, 2015 · 9 comments
Closed

Can't compile on El Capitan #448

alanorth opened this issue Sep 27, 2015 · 9 comments

Comments

@alanorth
Copy link

Using current master as of 2015-09-27 on El Capitan 10.11.1 beta. Assuming latest pyenv should bootstrap its own OpenSSL and readline:

$ pyenv install 3.4.3                              
Installing openssl-1.0.1p...
Installed openssl-1.0.1p to /Users/aorth/.pyenv/versions/3.4.3

Installing readline-6.3...
Installed readline-6.3 to /Users/aorth/.pyenv/versions/3.4.3

Installing Python-3.4.3...
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/yyuu/pyenv/wiki/Common-build-problems


BUILD FAILED (OS X 10.11.1 using python-build 20150913-13-g3ecc94f)

Trying to include Xcode paths (common build problems on Mac OS X):

$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 3.4.3                                                                                     
Installing openssl-1.0.1p...
Installed openssl-1.0.1p to /Users/aorth/.pyenv/versions/3.4.3

Installing readline-6.3...
Installed readline-6.3 to /Users/aorth/.pyenv/versions/3.4.3

Installing Python-3.4.3...
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/yyuu/pyenv/wiki/Common-build-problems


BUILD FAILED (OS X 10.11.1 using python-build 20150913-13-g3ecc94f)

I'm using pkgsrc instead of homebrew, so I tried to add relevant flags:

$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include -I/opt/pkg/include" LDFLAGS="-L/opt/pkg/lib" pyenv install 3.4.3
Installing openssl-1.0.1p...

Installed openssl-1.0.1p to /Users/aorth/.pyenv/versions/3.4.3

Installing readline-6.3...
Installed readline-6.3 to /Users/aorth/.pyenv/versions/3.4.3

Installing Python-3.4.3...
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/yyuu/pyenv/wiki/Common-build-problems


BUILD FAILED (OS X 10.11.1 using python-build 20150913-13-g3ecc94f)
@alanorth
Copy link
Author

Ok, I just tried in an environment without pkgsrc paths (/opt/pkg) and this worked:

$ pyenv install 3.4.3
Installing openssl-1.0.1p...
Installed openssl-1.0.1p to /Users/aorth/.pyenv/versions/3.4.3

Installing readline-6.3...
Installed readline-6.3 to /Users/aorth/.pyenv/versions/3.4.3

Installing Python-3.4.3...
Installed Python-3.4.3 to /Users/aorth/.pyenv/versions/3.4.3

I guess this is a problem with my environment mixing libs, headers, PATHs, etc. I'll close this now.

@case
Copy link

case commented Oct 2, 2015

Fwiw, this did the trick for me:

CFLAGS="-I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
pyenv install -v 3.4.3

@copperlight
Copy link

The above solution did not work in my case (an upgrade of a relatively fresh Yosemite to El Capitan). This worked for me:

xcode-select --install

brew install openssl
brew install readline
brew install pyenv --HEAD

export PYENV_ROOT=/usr/local/var/pyenv
pyenv install 2.7.10
pyenv install 3.4.3

@intentionally-left-nil
Copy link

FWIW, these are the settings I had to use (specifically note that including the --show-sdk-path did NOT work for me)

brew install readline
brew install openssl
brew install pyenv
brew install sqlite3
export CFLAGS="-I$(brew --prefix openssl)/include"
export LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix sqlite3)/lib"
export CPPFLAGS="-I$(brew --prefix sqlite3)/include"
pyenv install 2.7.10

@williamboman
Copy link

$ xcode-select --install did it for me

oh, and

$ brew list | egrep '(openssl|readline)'
openssl
readline

@living4life
Copy link

this works for me:

$ brew link --force openssl
$ xcode-select --install 
$ pyenv install 3.3.5
$ pyenv global 3.3.5

@toearth
Copy link

toearth commented May 20, 2016

This works for me:
brew install openssl
brew install pyenv
brew install sqlite3
export CFLAGS="-I$(brew --prefix openssl)/include"
export LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix sqlite3)/lib"
export CPPFLAGS="-I$(brew --prefix sqlite3)/include"
pyenv install 3.5.1

@mrhyh
Copy link

mrhyh commented Aug 2, 2017

Python-3.5.2.tar.xz...
-> https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz
error: failed to download Python-3.5.2.tar.xz

BUILD FAILED (OS X 10.12.6 using python-build 20160602)

Inspect or clean up the working tree at /var/folders/lt/qy668fzs32d4nxnvx8r2_p440000gn/T/python-build.20170801170723.7421
Results logged to /var/folders/lt/qy668fzs32d4nxnvx8r2_p440000gn/T/python-build.20170801170723.7421.log

Last 10 log lines:
/var/folders/lt/qy668fzs32d4nxnvx8r2_p440000gn/T/python-build.20170801170723.7421 ~
warning: xz not found; consider installing xz package
curl: (18) transfer closed with 13596292 bytes remaining to read
hyhdeMac-mini:~ hyh$ pyenv install -v pypy3.5-5.8.0-sr
python-build: definition not found: pypy3.5-5.8.0-sr

The following versions contain `pypy3.5-5.8.0-sr' in the name:
pypy3.5-5.8.0-src

See all available versions with `pyenv install --list'.

If the version you need is missing, try upgrading pyenv:

brew update && brew upgrade pyenv

@jalevin
Copy link

jalevin commented Apr 19, 2018

A few things to look at:

Besides pyenv I also could not install ruby versions via rbenv. At this point I started looking at the system. I'd recently upgraded and used the migration assistant to move to a new machine.

  1. go to Applications and run Xcode. I had additional packages install
  2. run brew doctor. if any files in /usr/local/include show up you have 2 options. Either rename the directory to something else like include_old or remove the offending entries. I chose the first.

sudo mv /usr/local/include /usr/local/include_old
sudo mkdir /usr/local/include
sudo chown $YOU_USERNAME:admin /usr/local/include

afterward, I was able to install ruby and python versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants