Skip to content

3.2 installation fails with SSL error #22

Closed
@notnoop

Description

@notnoop

pyenv install command fails when installing 3.2 but succeeds with 3.2.5 and 3.1.5:

ubuntu@box144:~$ pyenv install 3.1.5
Downloading Python-3.1.5.tgz...
-> http://www.python.org/ftp/python/3.1.5/Python-3.1.5.tgz
Installing Python-3.1.5...
Installed Python-3.1.5 to /home/ubuntu/.pyenv/versions/3.1.5

Downloading distribute-0.6.40.tar.gz... [...]
Downloading pip-1.3.1.tar.gz... [...]

ubuntu@box144:~$ pyenv install 3.2.5
Downloading Python-3.2.5.tgz...
-> http://yyuu.github.io/pythons/ed8d5529d2aebc36b53f4e0a0c9e6728
Installing Python-3.2.5...
Installed Python-3.2.5 to /home/ubuntu/.pyenv/versions/3.2.5

Downloading distribute-0.6.40.tar.gz... [...]
Downloading pip-1.3.1.tar.gz... [...]

ubuntu@box144:~$ pyenv install 3.2
Downloading Python-3.2.tgz...
-> http://yyuu.github.io/pythons/5efe838a7878b170f6728d7e5d7517af
Installing Python-3.2...

BUILD FAILED

Inspect or clean up the working tree at /tmp/python-build.20130522214215.31234
Results logged to /tmp/python-build.20130522214215.31234.log

Last 10 log lines:
  File "<string>", line 2, in <module>
  File "/home/ubuntu/.pyenv/versions/3.2/lib/python3.2/ssl.py", line 60, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: No module named _ssl

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 4, in <module>
ImportError: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Activity

added a commit that references this issue on May 23, 2013
yyuu

yyuu commented on May 23, 2013

@yyuu
Contributor

This might be a build problem of ssl module with recent version of OpenSSL. I added patch in SHA@5fbc3ae3d5629081507b691a3549007cff1cffc6 to prevent this error.

@notnoop
Please try rebuilding with latest master.

ghost assigned on May 27, 2013
yyuu

yyuu commented on Jun 13, 2013

@yyuu
Contributor

@notnoop
Aren't you there?

I close this since I've confirmed that the build problem has been fixed on my machine.

rnhmjoj

rnhmjoj commented on Jun 26, 2013

@rnhmjoj

I have the same problem. It's not yet fixed.
I tried installing openssl via homebrew but the problem persists.

yyuu

yyuu commented on Jun 27, 2013

@yyuu
Contributor

@rnhmjoj
Which version of Python did you met openssl problem with? Please show me the actual output of pyenv install --verbose ${version} as gist.

rnhmjoj

rnhmjoj commented on Jun 27, 2013

@rnhmjoj

@yyuu The version is version: 3.3.2. Here is the log.

yyuu

yyuu commented on Jun 27, 2013

@yyuu
Contributor

@rnhmjoj
hmm... looks somewhat strange :(

The build problem of ssl module of CPython 3.3.2 must be another problem. The problem on CPython 3.2 was caused by the recent changes in OpenSSL (it drops support for SSLv2).

https://github.com/yyuu/pyenv/blob/master/plugins/python-build/share/python-build/patches/3.2/Python-3.2/001_openssl_no_ssl2.patch

Though, CPython 3.3.2 is quite new and equivalent fix has been applied by default, this must not be a problem.

For more investigation, I'd like to have another issue for your problem.

beck

beck commented on Feb 12, 2014

@beck

Suggest looking into this ticket once more, was unable to install new pythons with homebrew installed openssl.

Ran into exact same problem and found this ticket:

$ brew upgrade pyenv
Error: pyenv-20140211 already installed
$ pyenv install 2.7.4
....
BUILD FAILED

Inspect or clean up the working tree at /var/folders/3y/7jrv6jr95fnbs9rr0vx1xwzc0000gn/T/python-build.20140212160358.97455
Results logged to /var/folders/3y/7jrv6jr95fnbs9rr0vx1xwzc0000gn/T/python-build.20140212160358.97455.log

Last 10 log lines:
  File "<string>", line 1, in <module>
  File "/Users/doug/.pyenv/versions/2.7.4/lib/python2.7/ssl.py", line 60, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: No module named _ssl

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

What worked for me:

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

yina commented on Feb 28, 2014

@yina

So I updated the 2.7.6 file with the changes in #22 and I still get the same error as the most recent comment from beck. Am I missing something simple. On MacOS Mavericks.
just running "pyenv install 2.7.6"

beck

beck commented on Feb 28, 2014

@beck

@yina in the end I had to ditch the homebrew openssl.
What ended up working for me:

brew uninstall openssl
brew upgrade pyenv
pyenv install 2.7.6
yina

yina commented on Feb 28, 2014

@yina

thanks beck. I should clarify that I am using macports for which openssl is installed. I do have the latest pyenv with "pyenv update" with the changes I made to the 2.7.6 file.

16 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @yina@yyuu@notnoop@beck@rohshall

      Issue actions

        3.2 installation fails with SSL error · Issue #22 · pyenv/pyenv