pmneila/PyMCubes

Installation with 3.10 pip deprecation warning

Germanunkol opened this issue · 1 comments

Hey, thanks a lot for this module!

I've used it successfully with python3.9, however when trying to install for python3.10, I get the following error:

./python3.10 -m pip install --upgrade PyMCubes

Collecting PyMCubes
  Using cached PyMCubes-0.1.2.tar.gz (42 kB)
  Preparing metadata (setup.py) ... done
Installing collected packages: PyMCubes
  DEPRECATION: PyMCubes is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for PyMCubes ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for PyMCubes did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      /home/micha/Software/blender-3.4.0-linux-x64/3.4/python/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      WARNING: The wheel package is not available.
      running install
      /home/micha/Software/blender-3.4.0-linux-x64/3.4/python/lib/python3.10/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-310
      creating build/lib.linux-x86_64-cpython-310/mcubes
      copying mcubes/torch_smoothing.py -> build/lib.linux-x86_64-cpython-310/mcubes
      copying mcubes/exporter.py -> build/lib.linux-x86_64-cpython-310/mcubes
      copying mcubes/smoothing.py -> build/lib.linux-x86_64-cpython-310/mcubes
      copying mcubes/version.py -> build/lib.linux-x86_64-cpython-310/mcubes
      copying mcubes/__init__.py -> build/lib.linux-x86_64-cpython-310/mcubes
      running build_ext
      building 'mcubes._mcubes' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/mcubes
      creating build/temp.linux-x86_64-cpython-310/mcubes/src
      gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/src/build_linux/deps/Release/sqlite/include -I/src/build_linux/deps/Release/bzip2/include -I/src/build_linux/deps/Release/lzma/include -I/src/build_linux/deps/Release/zlib/include -fPIC -fPIC -fPIC -Imcubes/src -I/home/micha/Software/blender-3.4.0-linux-x64/3.4/python/lib/python3.10/site-packages/numpy/core/include -I/home/micha/Software/blender-3.4.0-linux-x64/3.4/python/include/python3.10 -c mcubes/src/_mcubes.cpp -o build/temp.linux-x86_64-cpython-310/mcubes/src/_mcubes.o -std=c++11 -Wall
      mcubes/src/_mcubes.cpp:40:10: fatal error: Python.h: No such file or directory
       #include "Python.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.
╰─> PyMCubes

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

Using the mentioned flag --use-pep517 seems to be an option, but this then tries to build from source (if I understand correctly) which doesn't work on my system at the moment (because python3.10-dev is not available).

Hi @Germanunkol,

I have just released a new version of PyMCubes that includes a modern build system (pyproject.toml) and binary packages for multiple platforms. To install it, run the following command:

./python3.10 -m pip install --upgrade PyMCubes --no-cache-dir

If everything goes as expected, this command will install the binary package for your platform and will not require building it from source.

I hope this helps. Please let me know if you find any issue.