1

I have a numpy array that I want to convert into .vtk format so that I can later use it in ParaView. I installed pyevtk using pip install but when I import it using

from pyevtk.hl import gridToVTK

I get the error

No module named 'pyevtk'

Could someone please help me?

Thank you

Sergey Shubin
  • 3,040
  • 4
  • 24
  • 36
  • looks like the main folder of the `pyevtk` package is name `evtk`, so try to use `from evtk.hl import gridToVTK` – obchardon Apr 19 '21 at 15:47
  • you can also see [this similar thread](https://stackoverflow.com/questions/67188971/loading-large-3d-numpy-array-into-paraview) – Nico Vuaille Apr 21 '21 at 08:09

1 Answers1

0

Assuming, your python installation does not contain the pyevtk package, you'll have to make sure, it is properly installed. The installation procedure depends on your python installation.

If you are using pip:

pip install pyevtk

If you are using conda/anaconda, you have to make sure to install from the conda-forge repository, as it is not available in the regular repository:

conda install -c conda-forge pyevtk

If the package has been installed successfully, using your code to should work fine.

leomfn
  • 155
  • 1
  • 11