1

SO I am was working with errbot and fired up a virtualenv with python3.5. When I run the errbot command I get this error

from OpenSSL import crypto
  File "/Users/me/workspace/chatbotv2/chatbot_venv3/lib/python3.5/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/Users/me/workspace/chatbotv2/chatbot_venv3/lib/python3.5/site-packages/OpenSSL/rand.py", line 12, in <module>
    from OpenSSL._util import (
  File "/Users/me/workspace/chatbotv2/chatbot_venv3/lib/python3.5/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/Users/me/workspace/chatbotv2/chatbot_venv3/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 250, in <module>
    _verify_openssl_version(Binding.lib.SSLeay())
  File "/Users/me/workspace/chatbotv2/chatbot_venv3/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 230, in _verify_openssl_version
    "You are linking against OpenSSL 0.9.8, which is no longer "

This is 'asked to death' topic on SO so obviously I was abel to get a solution asap. I followed this answer. However When I run brew link --force openssl I get this :

Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
  -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

For which I tried :

export CPPFLAGS='-I/usr/local/opt/openssl/include'
export LDFLAGS='-L/usr/local/opt/openssl/lib'

After this I am lost and do not know what to do. When I try : python -c "import ssl; print (ssl.OPENSSL_VERSION)" I still get OpenSSL 0.9.8zg 14 July 2015. I am on OSX

Community
  • 1
  • 1
Beginner
  • 2,643
  • 9
  • 33
  • 51
  • two quick things: 1) did you try forcing brew to update openssl first before linking? `brew install openssl` then `brew link openssl --force` 2) did you check for multiple openssl instances in your path? – Liam Kelly Aug 24 '16 at 22:17
  • Yes I did update openssl to `openssl-1.0.2h_1`. WHen I do `$ echo $PYTHONPATH` in my virtualenv , it returns an empty string – Beginner Aug 24 '16 at 22:22
  • I need a little more info about your path. Try this: enter `which openssl`, then see if there is an openssl in `/usr/bin` and `/usr/local/bin`. I am guessing/hoping you will find one in both. – Liam Kelly Aug 24 '16 at 23:11
  • @Upsampled `which openssl` returns `/usr/local/bin/openssl` – Beginner Aug 24 '16 at 23:46
  • Try the instructions underneath the EDIT in this [post](http://stackoverflow.com/questions/38670295/brew-refusing-to-link-openssl) – Liam Kelly Aug 25 '16 at 00:36
  • Both commands return `File exists` – Beginner Aug 25 '16 at 03:01

1 Answers1

1

Upgrade your pip. pip 8.1+ will download a binary wheel that will have cryptography precompiled. If you want to compile it yourself the correct environment variables for homebrew can also be found in the docs on the installation page.

Paul Kehrer
  • 13,466
  • 4
  • 40
  • 57