Skip to content

import benepar fails with torch error #102

@chrisvdweth

Description

@chrisvdweth

When I try to import benepar with

import benepar

I get the following error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[7], line 1
----> 1 import benepar

File ~/env/anaconda3/envs/cs5246/lib/python3.9/site-packages/benepar/__init__.py:19
     10 __all__ = [
     11     "Parser",
     12     "InputSentence",
   (...)
     15     "NonConstituentException",
     16 ]
     18 from .integrations.downloader import download
---> 19 from .integrations.nltk_plugin import Parser, InputSentence
     20 from .integrations.spacy_plugin import BeneparComponent, NonConstituentException

File ~/env/anaconda3/envs/cs5246/lib/python3.9/site-packages/benepar/integrations/nltk_plugin.py:6
      3 from typing import List, Optional, Tuple
      5 import nltk
----> 6 import torch
      8 from .downloader import load_trained_model
      9 from ..parse_base import BaseParser, BaseInputExample

File ~/env/anaconda3/envs/cs5246/lib/python3.9/site-packages/torch/__init__.py:229
    227     if USE_GLOBAL_DEPS:
    228         _load_global_deps()
--> 229     from torch._C import *  # noqa: F403
    231 # Appease the type checker; ordinarily this binding is inserted by the
    232 # torch._C module initialization code in C
    233 if TYPE_CHECKING:

ImportError: /home/vdw/env/anaconda3/envs/cs5246/lib/python3.9/site-packages/torch/lib/libtorch_cuda.so: undefined symbol: ncclRedOpDestroy

The code was running in the past. I assume that anything happened when I updated my PyTorch version. What is the best way to fix this? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions