I was trying to install "causal_conv1d" using:
pip install --no-cache-dir -t /scratch/ahmed/lib causal_conv1d==1.0.0
The error I got is:
Collecting causal_conv1d==1.0.0
Downloading causal_conv1d-1.0.0.tar.gz (6.4 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-9i0wsv2k/causal-conv1d_fc0a21267f664102adca1aa336c93106/setup.py", line 19, in <module>
from torch.utils.cpp_extension import (
File "/scratch/ahmed/lib/torch/utils/cpp_extension.py", line 28, in <module>
from pkg_resources import packaging # type: ignore[attr-defined]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'packaging' from 'pkg_resources' (/scratch/ahmed/lib/pkg_resources/__init__.py)
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
I don't know the exact problem, but it seems this problem happened when I used two directories for Python "lib": one was the default Anaconda lib, and I had another separate one. The problem disappeared when I used only the default Anaconda lib. It works fine now.