简体   繁体   English

ModuleNotFoundError:没有名为“vtk”的模块

[英]ModuleNotFoundError: No module named 'vtk'

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?我在处理 pyvista 时遇到问题,它无法识别“vtk”模块,我尝试通过 cmd 安装它,但它不允许我,因为它会产生错误,我该怎么办?

    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有什么想法吗?,我正在使用 python 3.8.6

You can go on PyPi and find the correct installing command for VTK.您可以在 PyPi 上找到 go 并找到 VTK 的正确安装命令。 Here is the link: PyPi这是链接: PyPi

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此命令应该有效: pip install vtk

If not, I would recommend researching the error it is giving you.如果没有,我建议研究它给你的错误。

This error means that you do not have that module installed.此错误意味着您没有安装该模块。 You can install it using您可以使用安装它

pip install vtk

I'd verify that your install of Python is 64-bit.我会验证您安装的 Python 是 64 位的。 See https://stackoverflow.com/a/10966396/3369879https://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.运行python时,您应该看到类似[MSC v.1500 64 bit (AMD64)]的内容,其中64 bit (AMD64)表示您正在运行 64 位 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.我之所以这么说是因为VTK只有Python 64位轮子,并且在Windows中很常见意外下载和安装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.这是因为 32 位 Python 没有 VTK 轮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM