rusty1s/pytorch_cluster

Value Error While installing pytorch_cluster via pip (no absolute path)

Endunry opened this issue · 2 comments

Hey, im trying to install pytorch with a few dependencies to try out a repository i found. Everything worked so far, but when i run pip install torch-cluster, it gets an error in the setup.py.

  • Python-Version: 3.9.13 (using Anaconda)
  • conda: 23.1.0
  • Pytorch-Version: torch-2.0.0-cp39-cp39-win_amd64
  • Platform: CPU (No CUDA-cores)
  • torch_cluster: 1.6.0 (i never specified it, but its the one that it trys to install)

The Point where it fails is:

File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\_distutils\util.py", line 137, in convert_path
          raise ValueError("path '%s' cannot be absolute" % pathname)
      ValueError: path '/Users/rusty1s/github/pytorch_cluster/csrc/fps.cpp' cannot be absolute

Stack-Trace:

Installing collected packages: torch-cluster, torch-sparse, torch-geometric
  Running setup.py install for torch-cluster ... error
  error: subprocess-exited-with-error

  × Running setup.py install for torch-cluster did not run successfully.
  │ exit code: 1
  ╰─> [91 lines of output]
      running install
      C:\Users\rapha\anaconda3\lib\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.win-amd64-cpython-39
      creating build\lib.win-amd64-cpython-39\torch_cluster
      copying torch_cluster\fps.py -> build\lib.win-amd64-cpython-39\torch_cluster
      copying torch_cluster\graclus.py -> build\lib.win-amd64-cpython-39\torch_cluster
      copying torch_cluster\grid.py -> build\lib.win-amd64-cpython-39\torch_cluster
      copying torch_cluster\knn.py -> build\lib.win-amd64-cpython-39\torch_cluster
      copying torch_cluster\nearest.py -> build\lib.win-amd64-cpython-39\torch_cluster
      copying torch_cluster\radius.py -> build\lib.win-amd64-cpython-39\torch_cluster
      copying torch_cluster\rw.py -> build\lib.win-amd64-cpython-39\torch_cluster
      copying torch_cluster\sampler.py -> build\lib.win-amd64-cpython-39\torch_cluster
      copying torch_cluster\__init__.py -> build\lib.win-amd64-cpython-39\torch_cluster
      running egg_info
      writing torch_cluster.egg-info\PKG-INFO
      writing dependency_links to torch_cluster.egg-info\dependency_links.txt
      writing requirements to torch_cluster.egg-info\requires.txt
      writing top-level names to torch_cluster.egg-info\top_level.txt
      reading manifest file 'torch_cluster.egg-info\SOURCES.txt'
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\rapha\AppData\Local\Temp\pip-install-9li26aay\torch-cluster_b05b8a98822948bc8dcdbfadb81a331b\setup.py", line 98, in <module>
          setup(
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_commands
          self.run_command(cmd)
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
          super().run_command(command)
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
          cmd_obj.run()
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\command\install.py", line 68, in run
          return orig.install.run(self)
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\_distutils\command\install.py", line 692, in run
          self.run_command('build')
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
          self.distribution.run_command(command)
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
          super().run_command(command)
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
          cmd_obj.run()
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\command\build.py", line 24, in run
          super().run()
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
          self.run_command(cmd_name)
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
          self.distribution.run_command(command)
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
          super().run_command(command)
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
          path = convert_path(item)
        File "C:\Users\rapha\anaconda3\lib\site-packages\setuptools\_distutils\util.py", line 137, in convert_path
          raise ValueError("path '%s' cannot be absolute" % pathname)
      ValueError: path '/Users/rusty1s/github/pytorch_cluster/csrc/fps.cpp' cannot be absolute
      [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-cluster

Interesting, I don't see where we are storing absolute paths in the PyPi package TBH. Checked for this. What happens if you install via

pip install git+https://github.com/rusty1s/pytorch_cluster.git

Wow, i honestly didnt knew i could just do that (just giving it the git-adress)... The more you know.
Thank you for your quick answer, it now installs correctly without any problems (1.6.1 instead of 1.6.0). I checked again and i have newest pip installed aswell weird error i didnt saw anything that seemed like a absolute path either.