BachiLi / diffvg

Differentiable Vector Graphics Rasterization
https://people.csail.mit.edu/tzumao/diffvg/
Apache License 2.0
902 stars 152 forks source link

Installation on Windows #71

Closed jamesWalker55 closed 9 months ago

jamesWalker55 commented 9 months ago

Just writing this as a reference in case I need to build diffvg on Windows in the future. Here are the steps I took to take to install diffvg.

  1. Install Microsoft Visual C++
  2. If you get an error with get_config_var('LIBDIR'), edit setup.py and change it to the path to your Python's include folder, for my portable installation it was C:\Users\James\scoop\apps\miniconda3\23.5.2-0\pkgs\python-3.10.12-he1021f5_0\include
  3. If you get this: error : too few arguments for template template parameter "Tuple", follow the steps in this issue comment
  4. If you get an error about the nmake generator, delete the build folder and try again

After this I was able to successfully build diffvg. However, I still encountered an error with module 'diffvg' has no attribute 'FilterType'. To fix this:

  1. Rename the diffvg file to diffvg.pyd as instructed here

After this diffvg worked for me with no issues.