obi-ml-public / ehr_deidentification

Robust de-identification of medical notes using transformer architectures
MIT License
43 stars 11 forks source link

incorrect version of urllib3 by default #18

Open Akhil-Raj opened 4 months ago

Akhil-Raj commented 4 months ago

Hi, when I created the conda environment using the process mentioned in the README, the urllib3 version installed was 2.2.2, which is incompatible with the python version specified in the deid.yml file(3.7). That is causing issue the following error :

(deid_ehr) [akr4007@dc-gpu2 forward_pass]$ python 'Forward Pass.py' 
Traceback (most recent call last):
  File "Forward Pass.py", line 19, in <module>
    from transformers import HfArgumentParser, TrainingArguments
  File "/home/akr4007/miniforge3/envs/deid_ehr/lib/python3.7/site-packages/transformers/__init__.py", line 43, in <module>
    from . import dependency_versions_check
  File "/home/akr4007/miniforge3/envs/deid_ehr/lib/python3.7/site-packages/transformers/dependency_versions_check.py", line 36, in <module>
    from .file_utils import is_tokenizers_available
  File "/home/akr4007/miniforge3/envs/deid_ehr/lib/python3.7/site-packages/transformers/file_utils.py", line 49, in <module>
    import requests
  File "/home/akr4007/miniforge3/envs/deid_ehr/lib/python3.7/site-packages/requests/__init__.py", line 164, in <module>
    from .api import delete, get, head, options, patch, post, put, request
  File "/home/akr4007/miniforge3/envs/deid_ehr/lib/python3.7/site-packages/requests/api.py", line 11, in <module>
    from . import sessions
  File "/home/akr4007/miniforge3/envs/deid_ehr/lib/python3.7/site-packages/requests/sessions.py", line 15, in <module>
    from .adapters import HTTPAdapter
  File "/home/akr4007/miniforge3/envs/deid_ehr/lib/python3.7/site-packages/requests/adapters.py", line 60, in <module>
    from urllib3.contrib.socks import SOCKSProxyManager
  File "/home/akr4007/miniforge3/envs/deid_ehr/lib/python3.7/site-packages/urllib3/contrib/socks.py", line 76, in <module>
    class _TYPE_SOCKS_OPTIONS(typing.TypedDict):
AttributeError: module 'typing' has no attribute 'TypedDict'

I suggest adding a line in the deid.yml to install urllib 2.0.7 would help :

Doing so resolved the issue.