'Why can't torchtext find a symbol _ZN2at6detail10noopDeleteEPv?

Why can't torchtext find this symbol?

(synthesis) miranda9~/ultimate-utils $ python ~/type-parametric-synthesis/src/main.py --reproduce_10K --serial --debug --num_workers 0



Traceback (most recent call last):
  File "/home/miranda9/type-parametric-synthesis/src/main.py", line 32, in <module>
    from data_pkg.data_preparation import get_dataloaders, get_simply_type_lambda_calc_dataloader_from_folder
  File "/home/miranda9/type-parametric-synthesis/src/data_pkg/data_preparation.py", line 10, in <module>
    from torchtext.vocab import Vocab, vocab
  File "/home/miranda9/miniconda3/envs/synthesis/lib/python3.9/site-packages/torchtext/__init__.py", line 5, in <module>
    from . import vocab
  File "/home/miranda9/miniconda3/envs/synthesis/lib/python3.9/site-packages/torchtext/vocab.py", line 13, in <module>
    from torchtext._torchtext import (
ImportError: /home/miranda9/miniconda3/envs/synthesis/lib/python3.9/site-packages/torchtext/_torchtext.so: undefined symbol: _ZN2at6detail10noopDeleteEPv



Solution 1:[1]

Reinstall torchtext with the current version of pytorch:

e.g.

conda install -y torchtext -c pytorch

or for older versions of pytorch torchtext ImportError in colab

conda install -y torchtext==0.8.0 -c pytorch

Though in general it seems in my experience that torchtext install the right version of pytorch on its own...

Ref: https://github.com/PyTorchLightning/pytorch-lightning/issues/4533

Solution 2:[2]

I got a similar undefined symbol: _ZTVN5torch3jit6MethodE problem.

I solved it by remaking (make -j10) the whole project (some c++ programs involved).

A possible reason could be that I reinstalled CUDA with a different version and this kind of change affected the environment (context or something).

Just some random idea... hope you can get some spirit.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 sirius