cheind / pytorch-blender

:sweat_drops: Seamless, distributed, real-time integration of Blender into PyTorch data pipelines
MIT License
567 stars 44 forks source link

Installing blendtorch.btb fails #24

Closed YoursTruely closed 1 year ago

YoursTruely commented 1 year ago

Set up fails at blender --background --python <DST>/scripts/install_btb.py

Below is the terminal log

Blender 3.4.1 (hash 55485cb379f7 built 2022-12-20 01:51:19)
Read prefs: C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\3.4\config\userpref.blend
Installing Blender dependencies. This might take a while...
b'Looking in links: c:\\Users\\USERNAME\\AppData\\Local\\Temp\\tmpxxec3_tz\r\nRequirement already satisfied: setuptools in c:\\users\\USERNAME\\appdata\\roaming\\python\\python310\\site-packages (68.0.0)\r\nRequirement already satisfied: pip in c:\\users\\USERNAME\\appdata\\roaming\\python\\python310\\site-packages (23.1.2)\r\n'
b'Requirement already satisfied: pip in c:\\users\\USERNAME\\appdata\\roaming\\python\\python310\\site-packages (23.1.2)\r\n'
['C:\\Program Files\\Blender Foundation\\Blender 3.4\\3.4\\python\\bin\\python.exe', '-m', 'pip', 'install', '--upgrade', '--user', '-e', 'C:\\Users\\USERNAME\\Documents\\BlendTorch\\scripts\\..\\pkg_blender']
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [60 lines of output]
      C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python310\\site-packages\\setuptools\\dist.py:510: SetuptoolsDeprecationWarning: Invalid version: '"0.4.0"'.
      !!

              ********************************************************************************
              The version specified is not a valid version according to PEP 440.
              This may not work as expected with newer versions of
              setuptools, pip, and PyPI.

              By 2023-Sep-26, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://peps.python.org/pep-0440/ for details.
              ********************************************************************************

      !!
        self._validate_version(self.metadata.version)
      ['pyzmq>=18.1.1', 'numpy>=1.18.2', 'pyopengl>=3.1.5', 'minexr>=1.0.0', 'supershape>=1.1.0']
      running egg_info
      C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python310\\site-packages\\setuptools\\command\\egg_info.py:131: SetuptoolsDeprecationWarning: Invalid version: '"0.4.0"'.
      !!

              ********************************************************************************
              Version '"0.4.0"' is not valid according to PEP 440.

              Please make sure to specify a valid version for your package.
              Also note that future releases of setuptools may halt the build process
              if an invalid version is given.

              By 2023-Sep-26, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://peps.python.org/pep-0440/ for details.
              ********************************************************************************

      !!
        return _normalization.best_effort_version(tagged)
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\\Users\\USERNAME\\Documents\\BlendTorch\\pkg_blender\\setup.py", line 13, in <module>
          setup(
        File "C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python310\\site-packages\\setuptools\\__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python310\\site-packages\\setuptools\\_distutils\\core.py", line 185, in setup
          return run_commands(dist)
        File "C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python310\\site-packages\\setuptools\\_distutils\\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python310\\site-packages\\setuptools\\_distutils\\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python310\\site-packages\\setuptools\\dist.py", line 1234, in run_command
          super().run_command(command)
        File "C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python310\\site-packages\\setuptools\\_distutils\\dist.py", line 987, in run_command
          cmd_obj.ensure_finalized()
        File "C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python310\\site-packages\\setuptools\\_distutils\\cmd.py", line 111, in ensure_finalized
          self.finalize_options()
        File "C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python310\\site-packages\\setuptools\\command\\egg_info.py", line 218, in finalize_options
          parsed_version = packaging.version.Version(self.egg_version)
        File "C:\\Users\\USERNAME\\AppData\\Roaming\\Python\\Python310\\site-packages\\setuptools\\_vendor\\packaging\\version.py", line 198, in __init__
          raise InvalidVersion(f"Invalid version: '{version}'")
      setuptools.extern.packaging.version.InvalidVersion: Invalid version: '-0.4.0-'
      [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.
b"Obtaining file:///C:/Users/USERNAME/Documents/BlendTorch/pkg_blender\r\n  Preparing metadata (setup.py): started\r\n  Preparing metadata (setup.py): finished with status 'error'\r\n"
Efala commented 1 year ago

This looks like the same issue as #23 . The resolution was to remove the quotation marks from line 12.

I haven't tested this, and I'm only a beginner with writing Blender add-ons, but it seems that declaring __version__ in this file is inappropriate. Normally, the add-on version is declared in the bl_info dictionary, described here in the developer documentation.

cheind commented 1 year ago

@Efala @YoursTruely would you mind testing the latest develop - I believe I've found the culprit and fixed it.