HennyJie / BrainGB

Officially Accepted to IEEE Transactions on Medical Imaging (TMI, IF: 11.037) - Special Issue on Geometric Deep Learning in Medical Imaging.
MIT License
165 stars 42 forks source link

Installation errors #8

Closed aritche closed 9 months ago

aritche commented 1 year ago

Hi,

If I try to install BrainGB in a new conda environment (conda create -n braingb) on my machine (Ubuntu 20.04.3 LTS, python 3.8.10) with a GPU, via: "pip install BrainGB", I get the following output including errors:

Collecting BrainGB
  Using cached BrainGB-1.0.3-py3-none-any.whl (18 kB)
Collecting numpy>=1.19.5
  Using cached numpy-1.24.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
Collecting torch>=1.10.2
  Using cached torch-2.0.1-cp311-cp311-manylinux1_x86_64.whl (619.9 MB)
Collecting scikit-learn>=0.24.2
  Using cached scikit_learn-1.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.6 MB)
Collecting networkx>=2.5.1
  Using cached networkx-3.1-py3-none-any.whl (2.1 MB)
Collecting node2vec>=0.4.3
  Using cached node2vec-0.4.6-py3-none-any.whl (7.0 kB)
Collecting scipy
  Using cached scipy-1.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.1 MB)
Collecting torch-geometric
  Using cached torch_geometric-2.3.1.tar.gz (661 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting torch-scatter
  Using cached torch_scatter-2.1.1.tar.gz (107 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 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-a_jou45r/torch-scatter_83b3c88b392349f08eac35a458cb4c7b/setup.py", line 8, in <module>
          import torch
      ModuleNotFoundError: No module named 'torch'
      [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.

If I instead try to install BrainGB via: "pip install -r requirements.txt" (Ubuntu 20.04.3 LTS, python 3.8.10) I get the following output:

ERROR: Could not find a version that satisfies the requirement torch~=1.10.2 (from versions: 1.13.0, 1.13.1, 2.0.0, 2.0.1)
ERROR: No matching distribution found for torch~=1.10.2

If I instead try to create a conda env via: "conda create -n braingb anaconda" (Ubuntu 20.04.3 LTS, Python 3.8.16) then "pip install BrainGB", I get the following output with errors:

Collecting braingb
  Using cached BrainGB-1.0.3-py3-none-any.whl (18 kB)
Collecting torch-scatter
  Using cached torch_scatter-2.1.1.tar.gz (107 kB)
  Preparing metadata (setup.py) ... done
Collecting torch-geometric
  Using cached torch_geometric-2.3.1.tar.gz (661 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting node2vec>=0.4.3
  Using cached node2vec-0.4.6-py3-none-any.whl (7.0 kB)
Requirement already satisfied: networkx>=2.5.1 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from braingb) (2.8.4)
Requirement already satisfied: torch>=1.10.2 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from braingb) (1.12.1)
Requirement already satisfied: scipy in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from braingb) (1.10.0)
Requirement already satisfied: numpy>=1.19.5 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from braingb) (1.23.5)
Requirement already satisfied: scikit-learn>=0.24.2 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from braingb) (1.2.1)
Collecting torch-sparse
  Using cached torch_sparse-0.6.17.tar.gz (209 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: tqdm<5.0.0,>=4.55.1 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from node2vec>=0.4.3->braingb) (4.64.1)
Requirement already satisfied: gensim<5.0.0,>=4.1.2 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from node2vec>=0.4.3->braingb) (4.3.0)
Requirement already satisfied: joblib<2.0.0,>=1.1.0 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from node2vec>=0.4.3->braingb) (1.1.1)
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from scikit-learn>=0.24.2->braingb) (2.2.0)
Requirement already satisfied: typing_extensions in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from torch>=1.10.2->braingb) (4.4.0)
Requirement already satisfied: jinja2 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from torch-geometric->braingb) (3.1.2)
Requirement already satisfied: requests in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from torch-geometric->braingb) (2.28.1)
Requirement already satisfied: pyparsing in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from torch-geometric->braingb) (3.0.9)
Requirement already satisfied: psutil>=5.8.0 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from torch-geometric->braingb) (5.9.0)
Requirement already satisfied: smart-open>=1.8.1 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from gensim<5.0.0,>=4.1.2->node2vec>=0.4.3->braingb) (5.2.1)
Collecting FuzzyTM>=0.4.0
  Using cached FuzzyTM-2.0.5-py3-none-any.whl (29 kB)
Requirement already satisfied: MarkupSafe>=2.0 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from jinja2->torch-geometric->braingb) (2.1.1)
Requirement already satisfied: certifi>=2017.4.17 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from requests->torch-geometric->braingb) (2022.12.7)
Requirement already satisfied: idna<4,>=2.5 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from requests->torch-geometric->braingb) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from requests->torch-geometric->braingb) (1.26.14)
Requirement already satisfied: charset-normalizer<3,>=2 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from requests->torch-geometric->braingb) (2.0.4)
Collecting pyfume
  Using cached pyFUME-0.2.25-py3-none-any.whl (67 kB)
Requirement already satisfied: pandas in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from FuzzyTM>=0.4.0->gensim<5.0.0,>=4.1.2->node2vec>=0.4.3->braingb) (1.5.3)
Requirement already satisfied: python-dateutil>=2.8.1 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from pandas->FuzzyTM>=0.4.0->gensim<5.0.0,>=4.1.2->node2vec>=0.4.3->braingb) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from pandas->FuzzyTM>=0.4.0->gensim<5.0.0,>=4.1.2->node2vec>=0.4.3->braingb) (2022.7)
Collecting simpful
  Using cached simpful-2.11.0-py3-none-any.whl (32 kB)
Collecting fst-pso
  Using cached fst_pso-1.8.1-py3-none-any.whl
Requirement already satisfied: six>=1.5 in /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages (from python-dateutil>=2.8.1->pandas->FuzzyTM>=0.4.0->gensim<5.0.0,>=4.1.2->node2vec>=0.4.3->braingb) (1.16.0)
Collecting miniful
  Using cached miniful-0.0.6-py3-none-any.whl
Building wheels for collected packages: torch-geometric, torch-scatter, torch-sparse
  Building wheel for torch-geometric (pyproject.toml) ... done
  Created wheel for torch-geometric: filename=torch_geometric-2.3.1-py3-none-any.whl size=910459 sha256=732e7d13bc8a732818661a209b0d3a48adfba99695a0e8cf7b837314916c047d
  Stored in directory: /home/aritche/.cache/pip/wheels/b5/5d/40/7c7d9ae359e1ebb834f9fcc0b8a235c4dfe31a166b41279693
  Building wheel for torch-scatter (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [47 lines of output]
      No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-38
      creating build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/__init__.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/segment_coo.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/testing.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/placeholder.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/segment_csr.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/scatter.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/utils.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      creating build/lib.linux-x86_64-cpython-38/torch_scatter/composite
      copying torch_scatter/composite/__init__.py -> build/lib.linux-x86_64-cpython-38/torch_scatter/composite
      copying torch_scatter/composite/logsumexp.py -> build/lib.linux-x86_64-cpython-38/torch_scatter/composite
      copying torch_scatter/composite/softmax.py -> build/lib.linux-x86_64-cpython-38/torch_scatter/composite
      copying torch_scatter/composite/std.py -> build/lib.linux-x86_64-cpython-38/torch_scatter/composite
      running egg_info
      writing torch_scatter.egg-info/PKG-INFO
      writing dependency_links to torch_scatter.egg-info/dependency_links.txt
      writing requirements to torch_scatter.egg-info/requires.txt
      writing top-level names to torch_scatter.egg-info/top_level.txt
      reading manifest file 'torch_scatter.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files matching '*' found under directory 'test'
      adding license file 'LICENSE'
      writing manifest file 'torch_scatter.egg-info/SOURCES.txt'
      running build_ext
      building 'torch_scatter._segment_coo_cpu' extension
      creating build/temp.linux-x86_64-cpython-38
      creating build/temp.linux-x86_64-cpython-38/csrc
      creating build/temp.linux-x86_64-cpython-38/csrc/cpu
      gcc -pthread -B /home/aritche/miniconda3/envs/braingb/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_PYTHON -Icsrc -I/home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include -I/home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/TH -I/home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/THC -I/home/aritche/miniconda3/envs/braingb/include/python3.8 -c csrc/cpu/segment_coo_cpu.cpp -o build/temp.linux-x86_64-cpython-38/csrc/cpu/segment_coo_cpu.o -O3 -Wno-sign-compare -DAT_PARALLEL_OPENMP -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1016\" -DTORCH_EXTENSION_NAME=_segment_coo_cpu -D_GLIBCXX_USE_CXX11_ABI=1 -std=gnu++14
      cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
      In file included from /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/python.h:12,
                       from /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/extension.h:6,
                       from /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:6,
                       from csrc/cpu/../extensions.h:2,
                       from csrc/cpu/segment_coo_cpu.h:3,
                       from csrc/cpu/segment_coo_cpu.cpp:1:
      /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/csrc/utils/pybind.h:7:10: fatal error: pybind11/pybind11.h: No such file or directory
          7 | #include <pybind11/pybind11.h>
            |          ^~~~~~~~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for torch-scatter
  Running setup.py clean for torch-scatter
  Building wheel for torch-sparse (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [70 lines of output]
      No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-38
      creating build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/index_select.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/sample.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/storage.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/bandwidth.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/mul.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/convert.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/narrow.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/reduce.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/typing.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/spadd.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/__init__.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/masked_select.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/testing.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/tensor.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/spspmm.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/matmul.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/cat.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/rw.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/coalesce.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/add.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/select.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/metis.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/diag.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/saint.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/spmm.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/eye.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/transpose.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/utils.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      copying torch_sparse/permute.py -> build/lib.linux-x86_64-cpython-38/torch_sparse
      running egg_info
      writing torch_sparse.egg-info/PKG-INFO
      writing dependency_links to torch_sparse.egg-info/dependency_links.txt
      writing requirements to torch_sparse.egg-info/requires.txt
      writing top-level names to torch_sparse.egg-info/top_level.txt
      reading manifest file 'torch_sparse.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files matching '*' found under directory 'third_party/parallel-hashmap/css'
      warning: no previously-included files matching '*' found under directory 'third_party/parallel-hashmap/html'
      warning: no previously-included files matching '*' found under directory 'third_party/parallel-hashmap/tests'
      warning: no previously-included files matching '*' found under directory 'third_party/parallel-hashmap/examples'
      warning: no previously-included files matching '*' found under directory 'third_party/parallel-hashmap/benchmark'
      warning: no previously-included files matching '*' found under directory 'test'
      warning: no previously-included files matching '*' found under directory 'benchmark'
      adding license file 'LICENSE'
      writing manifest file 'torch_sparse.egg-info/SOURCES.txt'
      running build_ext
      building 'torch_sparse._neighbor_sample_cpu' extension
      creating build/temp.linux-x86_64-cpython-38
      creating build/temp.linux-x86_64-cpython-38/csrc
      creating build/temp.linux-x86_64-cpython-38/csrc/cpu
      gcc -pthread -B /home/aritche/miniconda3/envs/braingb/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_PYTHON -Icsrc -Ithird_party/parallel-hashmap -I/home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include -I/home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/TH -I/home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/THC -I/home/aritche/miniconda3/envs/braingb/include/python3.8 -c csrc/cpu/neighbor_sample_cpu.cpp -o build/temp.linux-x86_64-cpython-38/csrc/cpu/neighbor_sample_cpu.o -O3 -Wno-sign-compare -DAT_PARALLEL_OPENMP -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1016\" -DTORCH_EXTENSION_NAME=_neighbor_sample_cpu -D_GLIBCXX_USE_CXX11_ABI=1 -std=gnu++14
      cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
      In file included from /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/python.h:12,
                       from /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/extension.h:6,
                       from /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:6,
                       from csrc/cpu/../extensions.h:2,
                       from csrc/cpu/neighbor_sample_cpu.h:3,
                       from csrc/cpu/neighbor_sample_cpu.cpp:1:
      /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/csrc/utils/pybind.h:7:10: fatal error: pybind11/pybind11.h: No such file or directory
          7 | #include <pybind11/pybind11.h>
            |          ^~~~~~~~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for torch-sparse
  Running setup.py clean for torch-sparse
Successfully built torch-geometric
Failed to build torch-scatter torch-sparse
Installing collected packages: torch-scatter, torch-sparse, simpful, miniful, torch-geometric, fst-pso, pyfume, FuzzyTM, node2vec, braingb
  Running setup.py install for torch-scatter ... error
  error: subprocess-exited-with-error

  × Running setup.py install for torch-scatter did not run successfully.
  │ exit code: 1
  ╰─> [49 lines of output]
      No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
      running install
      /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-38
      creating build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/__init__.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/segment_coo.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/testing.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/placeholder.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/segment_csr.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/scatter.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      copying torch_scatter/utils.py -> build/lib.linux-x86_64-cpython-38/torch_scatter
      creating build/lib.linux-x86_64-cpython-38/torch_scatter/composite
      copying torch_scatter/composite/__init__.py -> build/lib.linux-x86_64-cpython-38/torch_scatter/composite
      copying torch_scatter/composite/logsumexp.py -> build/lib.linux-x86_64-cpython-38/torch_scatter/composite
      copying torch_scatter/composite/softmax.py -> build/lib.linux-x86_64-cpython-38/torch_scatter/composite
      copying torch_scatter/composite/std.py -> build/lib.linux-x86_64-cpython-38/torch_scatter/composite
      running egg_info
      writing torch_scatter.egg-info/PKG-INFO
      writing dependency_links to torch_scatter.egg-info/dependency_links.txt
      writing requirements to torch_scatter.egg-info/requires.txt
      writing top-level names to torch_scatter.egg-info/top_level.txt
      reading manifest file 'torch_scatter.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files matching '*' found under directory 'test'
      adding license file 'LICENSE'
      writing manifest file 'torch_scatter.egg-info/SOURCES.txt'
      running build_ext
      building 'torch_scatter._segment_coo_cpu' extension
      creating build/temp.linux-x86_64-cpython-38
      creating build/temp.linux-x86_64-cpython-38/csrc
      creating build/temp.linux-x86_64-cpython-38/csrc/cpu
      gcc -pthread -B /home/aritche/miniconda3/envs/braingb/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_PYTHON -Icsrc -I/home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include -I/home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/TH -I/home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/THC -I/home/aritche/miniconda3/envs/braingb/include/python3.8 -c csrc/cpu/segment_coo_cpu.cpp -o build/temp.linux-x86_64-cpython-38/csrc/cpu/segment_coo_cpu.o -O3 -Wno-sign-compare -DAT_PARALLEL_OPENMP -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1016\" -DTORCH_EXTENSION_NAME=_segment_coo_cpu -D_GLIBCXX_USE_CXX11_ABI=1 -std=gnu++14
      cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
      In file included from /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/python.h:12,
                       from /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/extension.h:6,
                       from /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:6,
                       from csrc/cpu/../extensions.h:2,
                       from csrc/cpu/segment_coo_cpu.h:3,
                       from csrc/cpu/segment_coo_cpu.cpp:1:
      /home/aritche/miniconda3/envs/braingb/lib/python3.8/site-packages/torch/include/torch/csrc/utils/pybind.h:7:10: fatal error: pybind11/pybind11.h: No such file or directory
          7 | #include <pybind11/pybind11.h>
            |          ^~~~~~~~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> torch-scatter

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

If I instead try to create a conda env via: "conda create -n braingb anaconda" (Ubuntu 20.04.3 LTS, Python 3.8.16) then "pip install -r requirements.txt", it runs almost entirely without error, but at the end the following error is returned:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
gensim 4.3.0 requires FuzzyTM>=0.4.0, which is not installed.
Successfully installed PyYAML-5.4.1 PythonWebHDFS-0.2.3 astor-0.8.1 contextlib2-21.6.0 h5py-3.6.0 json-tricks-3.16.1 libsvm-3.23.0.4 matplotlib-3.4.3 networkx-2.6.3 nni-2.10 nose-1.3.7 numpy-1.22.4 pandas-1.4.4 prettytable-3.7.0 responses-0.23.1 schema-0.7.5 scikit-learn-1.0.2 scipy-1.7.3 simplejson-3.19.1 tensorly-0.6.0 torch-1.10.2 torch-geometric-2.0.4 tqdm-4.62.3 typeguard-4.0.0 types-PyYAML-6.0.12.9 websockets-11.0.3
HennyJie commented 9 months ago

Hi, This issue may be due to a version mismatch between torch and torch-scatter. To resolve it, save the following command to a script. After saving, grant it execution permissions using chmod +x and then execute the script.

#!/bin/bash
TORCH=$(python -c "import torch; print(torch.__version__)")
CUDA=$(python -c "import torch; version = torch.version.cuda.replace('.', ''); print(f'cu{version}')")
pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html --upgrade
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html --upgrade
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html --upgrade
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html --upgrade
pip install torch-geometric --upgrade

Another suggestion is to install the packages listed in requirements.txt one by one. Start by ensuring that torch installs successfully. Once that's done, continue with the subsequent commands (especially 'torch-scatter' and 'torch-sparse', those are the packages that depend on torch). Thanks.