0

I am having problems when handling pyvista, it does not recognize the "vtk" module, I have tried to install it through the cmd of but it does not allow me since it generates an error, what can I do?

    import pyvista as pv
  File "C:\Users\DUVAN PACHECO\AppData\Roaming\Python\Python38\site-packages\pyvista\__init__.py", line 5, in <module>
    from pyvista.plotting import *
  File "C:\Users\DUVAN PACHECO\AppData\Roaming\Python\Python38\site-packages\pyvista\plotting\__init__.py", line 5, in <module>
    from .export_vtkjs import export_plotter_vtkjs, get_vtkjs_url
  File "C:\Users\DUVAN PACHECO\AppData\Roaming\Python\Python38\site-packages\pyvista\plotting\export_vtkjs.py", line 55, in <module>        
    import vtk
ModuleNotFoundError: No module named 'vtk'

any ideas?, I am using python 3.8.6

  • 2
    If you ever again face this kind of problem just do this - `pip install `. In your case just `pip install vtk`. And if you use python 3 then `pip3 install vtk`. – dedsec Jun 04 '21 at 04:18
  • 1
    this might help https://stackoverflow.com/questions/34997436/configuration-of-vtk-in-python-in-windows – Cool Breeze Jun 04 '21 at 04:20
  • When trying to install the module, I get this: Defaulting to user installation because normal site-packages is not writeable ERROR: Could not find a version that satisfies the requirement vtk (from versions: none) ERROR: No matching distribution found for vtk – Duvan Pacheco Jun 05 '21 at 19:46

4 Answers4

0

You can go on PyPi and find the correct installing command for VTK. Here is the link:PyPi

grad
  • 11
  • 3
  • ok the command is pip install vtk I checked it – grad Jun 04 '21 at 21:20
  • When trying to install the module, I get this: Defaulting to user installation because normal site-packages is not writeable ERROR: Could not find a version that satisfies the requirement vtk (from versions: none) ERROR: No matching distribution found for vtk – Duvan Pacheco Jun 05 '21 at 19:44
  • In general VTK tries to be as portable as possible; the specific configurations below are known to work and tested. VTK supports the following C++11 compilers: Microsoft Visual Studio 2015 or newer gcc 4.8.3 or newer Clang 3.3 or newer Apple Clang 5.0 (from Xcode 5.0) or newer Intel 14.0 or newer VTK supports the following operating systems: Windows Vista or newer Mac OS X 10.7 or newer Linux (ex: Ubuntu 12.04 or newer, Debian 4 or newer) – grad Jun 06 '21 at 00:46
0

What is the error you're experiencing when trying to install the module? We cannot help you if you do not include it.

This command should work: pip install vtk

If not, I would recommend researching the error it is giving you.

Paul Burkart
  • 132
  • 1
  • 6
  • when trying to install the module, I get this: Defaulting to user installation because normal site-packages is not writeable ERROR: Could not find a version that satisfies the requirement vtk (from versions: none) ERROR: No matching distribution found for vtk – Duvan Pacheco Jun 05 '21 at 19:42
0

This error means that you do not have that module installed. You can install it using

pip install vtk
0

I'd verify that your install of Python is 64-bit. See https://stackoverflow.com/a/10966396/3369879

When running python you should see something like [MSC v.1500 64 bit (AMD64)], where 64 bit (AMD64) indicates you're running 64-bit Python.

Reason why I say this is because VTK only has Python 64-bit wheels and it's common in Windows to accidentally download and install Python 32-bit. This is why you're getting:

ERROR: Could not find a version that satisfies the requirement vtk

It's because there are no VTK wheels for 32-bit Python.

Alex Kaszynski
  • 1,817
  • 2
  • 17
  • 17