ImportError: cannot import name 'ssl' from 'urllib3.util.ssl_'
thorunna opened this issue · comments
Þórunn Arnardóttir commented
When I tried to run the following:
python3 src/main.py train --model-path-base models/ --train-path data/gamalt_icepahc/train_random.clean --dev-path data/gamalt_icepahc/dev_random.clean --predict-tags --use-bert
An error arose:
Processing trees for training...
Constructing vocabularies...
Initializing model...
Traceback (most recent call last):
File "src/main.py", line 612, in <module>
main()
File "src/main.py", line 608, in main
args.callback(args)
File "src/main.py", line 564, in <lambda>
subparser.set_defaults(callback=lambda args: run_train(args, hparams))
File "src/main.py", line 203, in run_train
parser = parse_nk.NKChartParser(
File "/users/home/tha86/berk/self-attentive-parser-copy/src/parse_nk.py", line 711, in __init__
self.bert_tokenizer, self.bert = get_bert(hparams.bert_model, hparams.bert_do_lower_case)
File "/users/home/tha86/berk/self-attentive-parser-copy/src/parse_nk.py", line 569, in get_bert
from pytorch_pretrained_bert import BertTokenizer, BertModel
File "/users/home/tha86/.local/lib/python3.8/site-packages/pytorch_pretrained_bert/__init__.py", line 2, in <module>
from .tokenization import BertTokenizer, BasicTokenizer, WordpieceTokenizer
File "/users/home/tha86/.local/lib/python3.8/site-packages/pytorch_pretrained_bert/tokenization.py", line 25, in <module>
from .file_utils import cached_path
File "/users/home/tha86/.local/lib/python3.8/site-packages/pytorch_pretrained_bert/file_utils.py", line 20, in <module>
import boto3
File "/opt/share/python/3.8.1/lib/python3.8/site-packages/boto3/__init__.py", line 16, in <module>
from boto3.session import Session
File "/opt/share/python/3.8.1/lib/python3.8/site-packages/boto3/session.py", line 17, in <module>
import botocore.session
File "/opt/share/python/3.8.1/lib/python3.8/site-packages/botocore/session.py", line 29, in <module>
import botocore.credentials
File "/opt/share/python/3.8.1/lib/python3.8/site-packages/botocore/credentials.py", line 34, in <module>
from botocore.config import Config
File "/opt/share/python/3.8.1/lib/python3.8/site-packages/botocore/config.py", line 16, in <module>
from botocore.endpoint import DEFAULT_TIMEOUT, MAX_POOL_CONNECTIONS
File "/opt/share/python/3.8.1/lib/python3.8/site-packages/botocore/endpoint.py", line 22, in <module>
from botocore.awsrequest import create_request_object
File "/opt/share/python/3.8.1/lib/python3.8/site-packages/botocore/awsrequest.py", line 25, in <module>
import botocore.utils
File "/opt/share/python/3.8.1/lib/python3.8/site-packages/botocore/utils.py", line 31, in <module>
import botocore.httpsession
File "/opt/share/python/3.8.1/lib/python3.8/site-packages/botocore/httpsession.py", line 8, in <module>
from urllib3.util.ssl_ import (
ImportError: cannot import name 'ssl' from 'urllib3.util.ssl_' (/opt/share/python/3.8.1/lib/python3.8/site-packages/urllib3/util/ssl_.py)