Megidd
(Megidd)
April 17, 2024, 2:00pm
1
Minimal env
Even a minimal Environment like below would throw similar errors:
conda create -n minimal_pytorch python=3.6 pytorch torchvision torchaudio -c pytorch
source activate minimal_pytorch && python -c "import torch; print(torch.__version__)"
A similar undefined symbol
error is thrown:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/envs/minimal_pytorch/lib/python3.6/site-packages/torch/__init__.py", line 197, in <module>
from torch._C import * # noqa: F403
ImportError: /usr/local/envs/minimal_pytorch/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so: undefined symbol: iJIT_NotifyEvent
Python version
When Python version is omitted while creating the environment:
conda create -n minimal_pytorch python pytorch torchvision torchaudio -c pytorch
The error is resolved:
source activate minimal_pytorch && python -c "import torch; print(torch.__version__)"
PyTorch version is received without any error:
2.2.2
I’m kind of confused
Eventually, I guess I have to use a Docker container as suggested here:
The only way I found to make it work is to use a docker container with the required PyTorch version in it.
The PyTorch binaries are not built for Python 3.6 anymore, so the first command should install a torch<=1.10.2
if I’m not mistaken.
Use a newer Python version (3.8 - 3.12) and it should work.
1 Like
yrraadi-io
(Yash Rathod )
April 29, 2024, 4:12pm
3
I’m facing this issue with python 3.9.*, when installing pytorch via conda.
Megidd
(Megidd)
April 30, 2024, 6:36am
4
Eventually, I solved the problem by resolving version mismatches. The exact commands are here:
opened 09:22AM - 17 Apr 24 UTC
closed 11:39AM - 21 Apr 24 UTC
type::support
source::community
### Checklist
- [X] I added a descriptive title
- [X] I searched open report… s and couldn't find a duplicate
### What happened?
# Minimal env
A minimal environment like below is created:
```bash
conda create -n minimal_pytorch python=3.6 pytorch torchvision torchaudio -c pytorch
```
Just getting the PyTorch version by the following command would throw errors:
```bash
source activate minimal_pytorch && python -c "import torch; print(torch.__version__)"
```
This `undefined symbol` error is thrown:
```
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/envs/minimal_pytorch/lib/python3.6/site-packages/torch/__init__.py", line 197, in <module>
from torch._C import * # noqa: F403
ImportError: /usr/local/envs/minimal_pytorch/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so: undefined symbol: iJIT_NotifyEvent
```
## Python version
When Python version is omitted while creating the environment:
```bash
conda create -n minimal_pytorch python pytorch torchvision torchaudio -c pytorch
```
The error is resolved:
```
source activate minimal_pytorch && python -c "import torch; print(torch.__version__)"
```
PyTorch version is received without any error:
```
2.2.2
```
## Note
I have posted a question here too: https://stackoverflow.com/q/78328401/3405291
### Conda Info
```shell
active environment : minimal_pytorch
active env location : /usr/local/envs/minimal_pytorch
shell level : 1
user config file : /root/.condarc
populated config files : /usr/local/.condarc
conda version : 23.11.0
conda-build version : not installed
python version : 3.10.13.final.0
solver : libmamba (default)
virtual packages : __archspec=1=broadwell
__conda=23.11.0=0
__glibc=2.35=0
__linux=6.1.58=0
__unix=0=0
base environment : /usr/local (writable)
conda av data dir : /usr/local/etc/conda
conda av metadata url : None
channel URLs : https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
package cache : /usr/local/pkgs
/root/.conda/pkgs
envs directories : /usr/local/envs
/root/.conda/envs
platform : linux-64
user-agent : conda/23.11.0 requests/2.31.0 CPython/3.10.13 Linux/6.1.58+ ubuntu/22.04.3 glibc/2.35 solver/libmamba conda-libmamba-solver/23.12.0 libmambapy/1.5.5
UID:GID : 0:0
netrc file : None
offline mode : False
```
### Conda Config
```shell
==> /usr/local/.condarc <==
channels:
- conda-forge
always_yes: True
```
### Conda list
```shell
# packages in environment at /usr/local/envs/minimal_pytorch:
#
# Name Version Build Channel
_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 2_kmp_llvm conda-forge
blas 2.122 mkl conda-forge
blas-devel 3.9.0 22_linux64_mkl conda-forge
bzip2 1.0.8 hd590300_5 conda-forge
ca-certificates 2024.2.2 hbcca054_0 conda-forge
cudatoolkit 11.3.1 hb98b00a_13 conda-forge
dataclasses 0.8 pyh787bdff_2 conda-forge
ffmpeg 4.3 hf484d3e_0 pytorch
freetype 2.12.1 h267a509_2 conda-forge
gmp 6.3.0 h59595ed_1 conda-forge
gnutls 3.6.13 h85f3911_1 conda-forge
icu 73.2 h59595ed_0 conda-forge
jpeg 9e h0b41bf4_3 conda-forge
lame 3.100 h166bdaf_1003 conda-forge
lcms2 2.12 hddcbb42_0 conda-forge
ld_impl_linux-64 2.40 h41732ed_0 conda-forge
lerc 3.0 h9c3ff4c_0 conda-forge
libblas 3.9.0 22_linux64_mkl conda-forge
libcblas 3.9.0 22_linux64_mkl conda-forge
libdeflate 1.10 h7f98852_0 conda-forge
libffi 3.4.2 h7f98852_5 conda-forge
libgcc-ng 13.2.0 h807b86a_5 conda-forge
libgfortran-ng 13.2.0 h69a702a_5 conda-forge
libgfortran5 13.2.0 ha4646dd_5 conda-forge
libhwloc 2.10.0 default_h2fb2949_1000 conda-forge
libiconv 1.17 hd590300_2 conda-forge
liblapack 3.9.0 22_linux64_mkl conda-forge
liblapacke 3.9.0 22_linux64_mkl conda-forge
libnsl 2.0.1 hd590300_0 conda-forge
libpng 1.6.43 h2797004_0 conda-forge
libsqlite 3.45.2 h2797004_0 conda-forge
libstdcxx-ng 13.2.0 h7e041cc_5 conda-forge
libtiff 4.3.0 h0fcbabc_4 conda-forge
libuv 1.48.0 hd590300_0 conda-forge
libwebp-base 1.4.0 hd590300_0 conda-forge
libxml2 2.12.6 h232c23b_2 conda-forge
libzlib 1.2.13 hd590300_5 conda-forge
llvm-openmp 18.1.3 h4dfa4b3_0 conda-forge
mkl 2024.1.0 ha957f24_692 conda-forge
mkl-devel 2024.1.0 ha770c72_692 conda-forge
mkl-include 2024.1.0 ha957f24_692 conda-forge
ncurses 6.4.20240210 h59595ed_0 conda-forge
nettle 3.6 he412f7d_0 conda-forge
numpy 1.19.5 py36hfc0c790_2 conda-forge
olefile 0.46 pyh9f0ad1d_1 conda-forge
openh264 2.1.1 h780b84a_0 conda-forge
openjpeg 2.5.0 h7d73246_0 conda-forge
openssl 1.1.1w hd590300_0 conda-forge
pillow 8.3.2 py36h676a545_0 conda-forge
pip 21.3.1 pyhd8ed1ab_0 conda-forge
python 3.6.15 hb7a2778_0_cpython conda-forge
python_abi 3.6 2_cp36m conda-forge
pytorch 1.10.2 py3.6_cuda11.3_cudnn8.2.0_0 pytorch
pytorch-mutex 1.0 cuda pytorch
readline 8.2 h8228510_1 conda-forge
setuptools 58.0.4 py36h5fab9bb_2 conda-forge
sqlite 3.45.2 h2c6b66d_0 conda-forge
tbb 2021.12.0 h00ab1b0_0 conda-forge
tk 8.6.13 noxft_h4845f30_101 conda-forge
torchaudio 0.10.2 py36_cu113 pytorch
torchvision 0.11.3 py36_cu113 pytorch
typing_extensions 4.1.1 pyha770c72_0 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
xz 5.2.6 h166bdaf_0 conda-forge
zlib 1.2.13 hd590300_5 conda-forge
zstd 1.5.5 hfc55251_0 conda-forge
```
### Additional Context
_No response_