Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

After #1327, importing torchtext fails with error Undefined symbol: _ZTVN5torch3jit6MethodE #1360

@imaginary-person

Description

@imaginary-person

🐛 Bug

After the latest commit (#1327), builds succeed with Python 3.8.5 on Ubuntu 18.04, but importing torchtext fails with error Undefined symbol: _ZTVN5torch3jit6MethodE, if torch has also been built locally from the master branch.

If the HEAD of the cloned repo is changed to the commit before #1327, then this issue doesn't reproduce.

Traceback:

import torchtext
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/external/text/torchtext/__init__.py", line 5, in <module>
    from . import vocab
  File "/external/text/torchtext/vocab/__init__.py", line 11, in <module>
    from .vocab_factory import (
  File "/external/text/torchtext/vocab/vocab_factory.py", line 4, in <module>
    from torchtext._torchtext import (
ImportError: /external/text/torchtext/_torchtext.so: undefined symbol: _ZTVN5torch3jit6MethodE

Environment

PyTorch version: 1.10.0a0+git6a059f0
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.1 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~18.04) 9.4.0
Clang version: Could not collect
CMake version: version 3.10.2
Libc version: glibc-2.27

Python version: 3.8.0 (default, Feb 25 2021, 22:10:10)  [GCC 8.4.0] (64-bit runtime)
Python platform: Linux-4.15.0-147-generic-x86_64-with-glibc2.27
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] bert-pytorch==0.0.1a4
[pip3] numpy==1.21.1
[pip3] torch==1.10.0a0+git6a059f0
[pip3] torch-struct==0.4
[pip3] torchfile==0.1.0
[pip3] torchtext==0.11.0a0+0d7b9e2
[pip3] torchvision==0.10.0
[pip3] torchviz==0.0.2
[conda] Could not collect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions