Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError when import pyvista #6086

Open
IGR1chard opened this issue May 15, 2024 · 5 comments
Open

OSError when import pyvista #6086

IGR1chard opened this issue May 15, 2024 · 5 comments
Labels
bug Uh-oh! Something isn't working as expected. vtk-issue Issues on the VTK side

Comments

@IGR1chard
Copy link

IGR1chard commented May 15, 2024

When I import pyvista I got OSError:

Traceback (most recent call last):
  File "d:\AnacondaProject\3d\ADFNE\laserplot_g7.py", line 5, in <module>
    import pyvista as pv
  File "D:\Anaconda\envs\visu\lib\site-packages\pyvista\__init__.py", line 9, in <module>
    from pyvista.core import *
  File "D:\Anaconda\envs\visu\lib\site-packages\pyvista\core\__init__.py", line 4, in <module>
    from . import _vtk_core
  File "D:\Anaconda\envs\visu\lib\site-packages\pyvista\core\_vtk_core.py", line 12, in <module>
    from vtkmodules.vtkCommonCore import vtkVersion
  File "D:\Anaconda\envs\visu\lib\site-packages\vtkmodules\__init__.py", line 29, in <module>
    _delvewheel_patch_1_5_1()
  File "D:\Anaconda\envs\visu\lib\site-packages\vtkmodules\__init__.py", line 26, in _delvewheel_patch_1_5_1
    raise OSError('Error loading {}; {}'.format(lib, ctypes.FormatError()))
OSError: Error loading vtkFiltersProgrammable-9.3-07a206e88b17c662b9df3814d5ed1ea9.dll;

If keep restart the programme, it will return some similar error in in _delvewheel_patch_1_5_1:

Traceback (most recent call last):
  File "d:\AnacondaProject\3d\ADFNE\laserplot_g8.py", line 5, in <module>
    import pyvista as pv
  File "D:\Anaconda\envs\visu\lib\site-packages\pyvista\__init__.py", line 9, in <module>
    from pyvista.core import *
  File "D:\Anaconda\envs\visu\lib\site-packages\pyvista\core\__init__.py", line 4, in <module>
    from . import _vtk_core
  File "D:\Anaconda\envs\visu\lib\site-packages\pyvista\core\_vtk_core.py", line 12, in <module>
    from vtkmodules.vtkCommonCore import vtkVersion
  File "D:\Anaconda\envs\visu\lib\site-packages\vtkmodules\__init__.py", line 29, in <module>
    _delvewheel_patch_1_5_1()
  File "D:\Anaconda\envs\visu\lib\site-packages\vtkmodules\__init__.py", line 26, in _delvewheel_patch_1_5_1
    raise OSError('Error loading {}; {}'.format(lib, ctypes.FormatError()))
OSError: Error loading vtkIOCesium3DTiles-9.3-87b238eef7c7b7987a8853dea9c38451.dll;

However, sometimes the code works fine, i don't know what's going on here.

Steps to reproduce the bug.

import pyvista as pv

System Information

--------------------------------------------------------------------------------
  Date: Wed May 15 21:10:04 2024 中国标准时间

                OS : Windows
            CPU(s) : 16
           Machine : AMD64
      Architecture : 64bit
       Environment : Python
        GPU Vendor : NVIDIA Corporation
      GPU Renderer : NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2
       GPU Version : 4.5.0 NVIDIA 537.42
  MathText Support : False

  Python 3.8.19 (default, Mar 20 2024, 19:55:45) [MSC v.1916 64 bit (AMD64)]

           pyvista : 0.43.7
               vtk : 9.3.0
             numpy : 1.24.3
        matplotlib : 3.7.2
            scooby : 0.9.2
             pooch : 1.7.0
            pillow : 10.2.0
             PyQt5 : 5.15.10
           IPython : 8.12.3
        ipywidgets : 8.1.2
             scipy : 1.10.1
              tqdm : 4.66.2
      nest_asyncio : 1.6.0

  Intel(R) oneAPI Math Kernel Library Version 2023.1-Product Build 20230303
  for Intel(R) 64 architecture applications
--------------------------------------------------------------------------------

Screenshots

No response

@IGR1chard IGR1chard added the bug Uh-oh! Something isn't working as expected. label May 15, 2024
@tkoyama010
Copy link
Member

The error seems vtk importing problem around IOCesium3DTiles. @pyvista/kitware Any thought?

@tkoyama010 tkoyama010 added the vtk-issue Issues on the VTK side label Jun 3, 2024
@johnkit
Copy link

johnkit commented Jun 5, 2024

I wasn't able to reproduce the symptom on linux, either using conda or python venv, with:

  • Python 3.8
  • pyvista 0.43.7
  • vtk 9.2.6 in conda venv; 9.3.0 in python venv

Can you give us a bit more info on the configuration? The path names suggest you are using conda however conda only has vtk 9.2.6.

Also, can you create a new/standalone venv and just install and try pyvista by itself?

We don't have many windows developers here, so I'm not sure when we try on that OS.

@IGR1chard
Copy link
Author

@johnkit I programmed using VS code and installed Python using Anaconda. The packages were manually installed through Conda prompt. The Python path in VS code comes from Anaconda.

@johnkit
Copy link

johnkit commented Jun 6, 2024

Would you please

  1. Make a new/empty conda environment and activate it.
  2. Install PyVista (conda install pyvista).
  3. Run Python from the conda prompt and see if it can import pyvista.
  4. If there is an error, please post both the error messages and the output of conda list.

@jourdain
Copy link
Contributor

jourdain commented Jun 6, 2024

Conda recipe for vtk before 9.3 was missing lots of modules and would not work with pyvista/trame.
I'm not saying that is the issue here. I'm just worried that you will run into other issues down the road.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Uh-oh! Something isn't working as expected. vtk-issue Issues on the VTK side
Projects
None yet
Development

No branches or pull requests

4 participants