PyOpenSSL not detectable (help!)

1,411 views
Skip to first unread message

Yang Jerng Hwa

unread,
Oct 18, 2014, 11:28:20 AM10/18/14
to google-c...@googlegroups.com
Hi folks,

I've gone through these instructions: https://cloud.google.com/sdk/crypto ; I've tried reinstalling Python, pip, python-openssl, and python-cryptography (the last two, in pip, using the respective package names), and setting the environmental variable, but I still get the following error. 

OS: 
Ubuntu 14.04 64bit

Command:
gcloud auth activate-service-account --key-file dockers/gcloud-sdk/keyfile.p12 --prompt-for-password x...@gmail.com

Error: 
ERROR: (gcloud.auth.activate-service-account) PyOpenSSL is not available. If you have already installed PyOpenSSL, you will need to enable site packages by setting the environment variable CLOUDSDK_PYTHON_SITEPACKAGES to 1. If that does not work, See https://developers.google.com/cloud/sdk/crypto for details.

Please comment/assist?

Thank you!

Jerng 

Jeff Vaughan

unread,
Oct 20, 2014, 7:33:27 PM10/20/14
to google-c...@googlegroups.com, Yang Jerng Hwa
Hi Jerng,

I’ve not been able to reproduce the behavior you’re seeing.  As a first step, could you try to reproduce the following python session?  This is just checking to makes sure that your python installation is finding pyopenssl and reading the environment correctly.

  $ python
  ...
  >>> import OpenSSL
  >>> print OpenSSL.crypto
  <module 'OpenSSL.crypto' from '/usr/lib/.../crypto.so'>
  >>> import os
  >>> print os.environ['CLOUDSDK_PYTHON_SITEPACKAGES']
  1
  >>> quit()

Cheers,
Jeff

On October 18, 2014 at 8:28:25 AM, Yang Jerng Hwa (yang...@gmail.com) wrote:
> Hi folks,
>
> I've gone through these instructions: https://cloud.google.com/sdk/crypto ;
> I've tried reinstalling Python, pip, python-openssl, and
> python-cryptography (the last two, in pip, using the respective package
> names), and setting the environmental variable, but I still get the
> following error.
>
> *OS: *
> Ubuntu 14.04 64bit
>
> *Command:*
> gcloud auth activate-service-account --key-file
> dockers/gcloud-sdk/keyfile.p12 --prompt-for-password x...@gmail.com
>
> *Error: *
> ERROR: (gcloud.auth.activate-service-account) PyOpenSSL is not available.
> If you have already installed PyOpenSSL, you will need to enable site
> packages by setting the environment variable CLOUDSDK_PYTHON_SITEPACKAGES
> to 1. If that does not work, See
> https://developers.google.com/cloud/sdk/crypto for details.
>
>
> Please comment/assist?
>
> Thank you!
>
> Jerng
>
> --
> You received this message because you are subscribed to the Google Groups "google-cloud-sdk"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-cloud-sdk.
> To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sdk/d95b00b3-8a4e-40e2-a305-04734a13a675%40googlegroups.com.
>

krishnav...@move.com

unread,
Apr 13, 2016, 5:26:06 PM4/13/16
to google-cloud-sdk, yang...@gmail.com
Hi,

I am running into the same issue as Jerng. 

I get this error when i try gcloud auth activate-service-account --key-file file  accountinfo

ERROR: (gcloud.auth.activate-service-account) PyOpenSSL is not available. See https://developers.google.com/cloud/sdk/crypto for details. 


Here is my OS info.

CentOS release 6.7 (Final)

Cloud SDK version is: 105.0.0


pip show pyopenssl

---

Metadata-Version: 2.0

Name: pyOpenSSL

Version: 16.0.0



 I tried downgrading pyOpenSSL to 0.15.1 and  Google Cloud SDK to  98.0.0 , still get the same error.


Any help would be greatly appreciated.


Thanks,

Krishna






krishnav...@move.com

unread,
Apr 13, 2016, 5:36:04 PM4/13/16
to google-cloud-sdk, yang...@gmail.com
Update - I ran the instructions given  - works as listed 

  >>> import OpenSSL 
  >>> print OpenSSL.crypto 
  <module 'OpenSSL.crypto' from '/usr/lib/.../crypto.so'> 
  >>> import os 
  >>> print os.environ['CLOUDSDK_PYTHON_SITEPACKAGES'] 
  1 
  >>> quit() 

- Krishna

Zachary Newman

unread,
Apr 13, 2016, 10:02:38 PM4/13/16
to krishnav...@move.com, google-cloud-sdk, yang...@gmail.com
To clarify, Krishna, when you say "works as listed," you mean that everything is figured out? Or are you still running into issues?

Cheers,
Zack

--
You received this message because you are subscribed to the Google Groups "google-cloud-sdk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-s...@googlegroups.com.

krishnav...@move.com

unread,
Apr 14, 2016, 11:34:59 AM4/14/16
to google-cloud-sdk, krishnav...@move.com, yang...@gmail.com
Zack,

Sorry for the confusion. It still does not work.  I tried the steps listed by Jeff in the thread to test import OpenSSL. That works correctly.

I am getting the same error with 2 different sdk version. 105 & 98.  ERROR: (gcloud.auth.activate-service-account) PyOpenSSL is not available. See https://developers.google.com/cloud/sdk/crypto for details. 

python 
  ... 

  >>> import OpenSSL 
  >>> print OpenSSL.crypto 
  <module 'OpenSSL.crypto' from '/usr/lib/.../crypto.so'> 
  >>> import os 
  >>> print os.environ['CLOUDSDK_PYTHON_SITEPACKAGES'] 
  1 
  >>> quit() 

Zachary Newman

unread,
Apr 14, 2016, 12:40:08 PM4/14/16
to krishnav...@move.com, google-cloud-sdk, yang...@gmail.com
Hm...I'm unable to reproduce (see my attached log file) with Cloud SDK 102, PyOpenSSL 16.0.0, Python 2.6.6, and CentOS 6.7.

Is there anything unusual about your Python setup? Do you have multiple Python installations? Do you have any other hints that might help us reproduce the issue? Can you reproduce on a fresh CentOS machine (if you can give me steps for doing so on a Google Compute Engine VM, I can definitely get to the bottom of the issue).

--
You received this message because you are subscribed to the Google Groups "google-cloud-sdk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-cloud-sdk.
repro.log

krishnav...@move.com

unread,
Apr 14, 2016, 1:11:48 PM4/14/16
to google-cloud-sdk, krishnav...@move.com, yang...@gmail.com
Thank you Zack for the hint.  Here is the update.

I have CentOS came with default  python 2.6.6 , I updated python version to 2.7.11

So PyOpenSSL was installed under python  2.7.11.

The FIX is to to set this -> export CLOUDSDK_PYTHON=python2.7

Thanks,
Krishna
Reply all
Reply to author
Forward
0 new messages