Home > Software design >  ImportError: cannot import name 'OP_NO_TICKET' from 'urllib3.util.ssl_'
ImportError: cannot import name 'OP_NO_TICKET' from 'urllib3.util.ssl_'

Time:11-09

I started running airflow locally and while running docker specifically: docker-compose run -rm web server initdb I started seeing this error. I hadn't seen this issue prior to this afternoon, wondering if anyone else has come upon this.

cannot import name 'OP_NO_TICKET' from 'urllib3.util.ssl_'

2021-11-08 20:55:08,137] {{plugins_manager.py:236}} ERROR - cannot import name 'OP_NO_TICKET' from 'urllib3.util.ssl_' (/usr/local/lib/python3.8/site-packages/urllib3/util/ssl_.py)
Traceback (most recent call last):
 File "/usr/local/lib/python3.8/site-packages/airflow/plugins_manager.py", line 228, in load_plugins_from_plugin_directory
  loader.exec_module(mod)
 File "<frozen importlib._bootstrap_external>", line 843, in exec_module
 File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
 File "/usr/local/airflow/repo/plugins/mysql_plugin/hooks/vice_mysql_hook.py", line 4, in <module>
  from airflow.providers.amazon.aws.hooks.s3 import S3Hook
 File "/usr/local/lib/python3.8/site-packages/airflow/providers/amazon/aws/hooks/s3.py", line 33, in <module>
  from boto3.s3.transfer import S3Transfer, TransferConfig
 File "/usr/local/lib/python3.8/site-packages/boto3/__init__.py", line 16, in <module>
  from boto3.session import Session
 File "/usr/local/lib/python3.8/site-packages/boto3/session.py", line 17, in <module>
  import botocore.session
 File "/usr/local/lib/python3.8/site-packages/botocore/session.py", line 29, in <module>
  import botocore.credentials
 File "/usr/local/lib/python3.8/site-packages/botocore/credentials.py", line 34, in <module>
  from botocore.config import Config
 File "/usr/local/lib/python3.8/site-packages/botocore/config.py", line 16, in <module>
  from botocore.endpoint import DEFAULT_TIMEOUT, MAX_POOL_CONNECTIONS
 File "/usr/local/lib/python3.8/site-packages/botocore/endpoint.py", line 22, in <module>
  from botocore.awsrequest import create_request_object
 File "/usr/local/lib/python3.8/site-packages/botocore/awsrequest.py", line 24, in <module>
  import botocore.utils
 File "/usr/local/lib/python3.8/site-packages/botocore/utils.py", line 32, in <module>
  import botocore.httpsession
 File "/usr/local/lib/python3.8/site-packages/botocore/httpsession.py", line 10, in <module>
  from urllib3.util.ssl_ import (
ImportError: cannot import name 'OP_NO_TICKET' from 'urllib3.util.ssl_' (/usr/local/lib/python3.8/site-packages/urllib3/util/ssl_.py)

CodePudding user response:

I have the same issue in my CI/CD using GitLab-CI. The awscli version 1.22.0 have this problem. I solved temporally the problem changed in my gitlab-ci file the line:

pip install awscli --upgrade --user

By:

pip install awscli==1.21.12 --user

Because when you call latest, the version that comes is 1.22.0

  • Related