nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.26k stars 233 forks source link

Can't install Cython compiled version of GeomDL or PyMCubes in Blender 4.1 because `--install-option` is depreciated in Python 3.11.7. #5117

Open futuremotiondev opened 6 months ago

futuremotiondev commented 6 months ago

Problem statement

From the wiki:

but this way you will get pure-python library, which is very slow. If you want it fast, then you have to install Cython (see previous paragraph for instruction). After you installed Cython, you can install "cythonized" geomdl as it is described in Geomdl instruction:

The steps in the relevant WIKI state to install GeomDL like this:

C:\Program Files\Blender Foundation\Blender 4.1\4.1\python\bin> .\python.exe -m pip install geomdl --install-option="--use-cython"

But --install-option is now depreciated in Python 3.11.7 and there is no instruction on how to build a "Cythonized" (Compiled) version of GeomDL (or PyMCubes either) for the added speed boost / optimizations that Cython provides for Blender 4+ builds.

Steps to reproduce

  1. Install Blender 4.1
  2. Navigate to C:\Program Files\Blender Foundation\Blender 4.1\4.1\python\bin in an elevated Powershell or CMD shell.
  3. Ensure PIP is installed and updated by following this.
  4. Run .\python.exe -m pip install Cython
  5. Run .\python.exe -m pip install geomdl --install-option="--use-cython" (Powershell), or python.exe -m pip install geomdl --install-option="--use-cython" (CMD).
  6. View error.

Expected result

A Cython compiled install of GeomDL with the promised speed boost.

Actual result

no such option: --install-option

Sverchok version

From sverchok-master.zip

Any help or information would be greatly appreciated!

satabol commented 6 months ago

Hi @futuremotiondev Can you try these steps? (replace paths to your Blender install path)

https://github.com/orbingol/NURBS-Python

cd /d E:\Enternet\Projects\github.com\NURBS-Python "E:\install\Blender\blender-4.1.1-windows-x64\4.1\python\Scripts\pip.exe" install --user . --config-settings="--use-cython=True"

image

comment: Source Sverchok docs geomdl: https://github.com/nortikin/sverchok/wiki/GeomDL

futuremotiondev commented 6 months ago

It successfully installed after following your steps. Not sure if it's actually Cython-compiled, but it worked. Is there any way to test if the install is "Cythonized"?

satabol commented 6 months ago

Hi @futuremotiondev

You are right! I read instruction more carefully and test my build. It is not cytonized version. image

I have Visual Studio Community Edition 2022: image

I have read in the docs about MinGW. I did not try it.

Now I did next steps: (change path to your blender path and local python path) mklink /d "e:\install\Blender\blender-4.1.1-windows-x64\4.1\python\include" "D:\Python\Python.3.10.11\include" mklink /d "e:\install\Blender\blender-4.1.1-windows-x64\4.1\python\include" "D:\Python\Python.3.10.11\include" e:\install\Blender\blender-4.1.1-windows-x64\4.1\python\bin\python.exe setup.py build_ext --use-cython --inplace install and now you can see work of compilator: image

Now one can import libraries but with some changes:

image

Also pay attention that this library NURBS-Python did not updated for 3 years: image

so sublibraries can be outdated (like a numpy library).