Open akaszynski opened 1 year ago
@akaszynski - are you installing OCP via conda?
This is all just from good old pip
.
@akaszynski I see. This may not be an adequate solution for you, but this should "just work" if you use conda
. I certainly understand the many reasons you might not want to use conda.
This seems to be mainly an issue with the wheels, whose builds are handled in a separate project - https://github.com/CadQuery/ocp-build-system/.
Cross-referencing your issue there (https://github.com/CadQuery/ocp-build-system/issues/14)
Yep, I recall opening that there, but reposted here so that others could know there's a solution.
Sadly, conda isn't an option for me at this point due to issues repackaging with pyinstaller
. One solution I thought of was creating a simple fork of pyvista
called pyvista-no-vtk
that installs pyvista
without installing vtk. PyVista (for my use case) still works out of the box since we use only vtkmodules
.
Here's another (albeit still non-ideal) hack. Install everything normally and then proceed to reinstall cadquery
after deleting the vtkmodules
directory:
pip install pyvista cadquery
rm -rf ~/.venv311/lib/python3.11/site-packages/vtkmodules # will need to modify the directory
pip install cadquery --force-reinstall
Yep, I recall opening that there, but reposted here so that others could know there's a solution.
Thanks for sharing, noted. Still, the advised installation method is conda.
Sadly, conda isn't an option for me at this point due to issues repackaging with
pyinstaller
. One solution I thought of was creating a simple fork ofpyvista
calledpyvista-no-vtk
that installspyvista
without installing vtk. PyVista (for my use case) still works out of the box since we use onlyvtkmodules
.
There should not be any fundamental issue pyinstaller and conda. BTW: recently for CQ-editor, we switched to constructor. Maybe something to try?
Ran into an issue recently where tessellation to VTK wasn't working:
Where
pdata
was output asNone
. Same issue using the more concise:After a bit of debugging, turns out the issue will occur if you install
vtk
with:pip install vtk==9.2.5
.Since OCP installs the
vtkmodules
directory, this is silently overwritten when installingvtk
.This is an issue on my end since I'm using
cadquery
and I'd like to also plot the resulting CAD usingpyvista
, which depends on thevtk
package. The only way I can think to work around this is to installpyvista
with no dependencies. If anyone wishes to plot cadquery shapes usingpyvista
, here's a minimum working example:Followed by installing pyvista without VTK
This works and the plots look great!
Ask for the maintainers: Is there any way for
OCP
to use a pre-compiled version of VTK? Is there any other way of working around this issue?