["python","google-analytics-api"]
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

Recently I had to reinstall Python due to a corrupt executable. This made one of our Python scripts bomb with the following error: AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK' The line of code that caused it to bomb was: from apiclient.discovery import build I tried pip uninstalling and pip upgrading the google-api-python-client, but I can’t seem to find any information on this particular error. For what it is worth, I am trying to pull Google Analytics information down via an API call. Here is an output of the command prompt error: File "C:\Analytics\Puritan_GoogleAnalytics\Google_Conversions\mcfTest.py", line 1, in <module> from apiclient.discovery import build File "C:\ProgramData\Anaconda3\lib\site-packages\apiclient\__init__.py", line 3, in <module> from googleapiclient import channel, discovery, errors, http, mimeparse, model File "C:\ProgramData\Anaconda3\lib\site-packages\googleapiclient\discovery.py", line 57, in <module> from googleapiclient import _auth, mimeparse File "C:\ProgramData\Anaconda3\lib\site-packages\googleapiclient\_auth.py", line 34, in <module> import oauth2client.client File "C:\ProgramData\Anaconda3\lib\site-packages\oauth2client\client.py", line 45, in <module> from oauth2client import crypt File "C:\ProgramData\Anaconda3\lib\site-packages\oauth2client\crypt.py", line 45, in <module> from oauth2client import _openssl_crypt File "C:\ProgramData\Anaconda3\lib\site-packages\oauth2client\_openssl_crypt.py", line 16, in <module> from OpenSSL import crypto File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\__init__.py", line 8, in <module> from OpenSSL import crypto, SSL File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\crypto.py", line 1517, in <module> class X509StoreFlags(object): File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\crypto.py", line 1537, in X509StoreFlags CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
Upgrade the latest version of PyOpenSSL. python3 -m pip install pip --upgrade pip install pyopenssl --upgrade