conda-forge / paraview-feedstock

A conda-smithy repository for paraview.
BSD 3-Clause "New" or "Revised" License
5 stars 20 forks source link

Paraview Import Error in macOS #120

Closed ma-sadeghi closed 3 years ago

ma-sadeghi commented 3 years ago

I'm duplicating the issue I opened up on Paraview's Gitlab page since this is probably the place to fix it. @jschueller I'd really appreciate it if you could look into this. Thanks so much.

""" We depend on paraview (which we get from conda-forge) in our package porespy. We recently noticed that the macOS CI fails due to the following error, which I couldn't decipher. I'd really appreciate it if someone could help us out. Many thanks! Btw, we're using v5.9.0. Also, other CIs (Ubuntu and Windows) work fine, so it seems that it's just a macOS issue.

test/unit/test_io.py:81: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
porespy/io/__funcs__.py:311: in to_paraview
    import paraview.simple
/usr/local/miniconda/envs/test/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
/usr/local/miniconda/envs/test/lib/python3.8/site-packages/paraview/simple.py:41: in <module>
    from paraview import servermanager
/usr/local/miniconda/envs/test/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    r"""servermanager is a module for using paraview server manager in Python.
    One can always use the server manager API directly. However, this module
    provides an interface easier to use from Python by wrapping several VTK
    classes around Python classes.

    Note that, upon load, this module will create several sub-modules: sources,
    filters and rendering. These modules can be used to instantiate specific
    proxy types. For a list, try "dir(servermanager.sources)"

    Usually users should use the paraview.simple module instead as it provide a
    more user friendly API.

    A simple example::

      from paraview.servermanager import *

      # Creates a new built-in session and makes it the active session.
      Connect()

      # Creates a new render view on the active session.
      renModule = CreateRenderView()

      # Create a new sphere proxy on the active session and register it
      # in the sources group.
      sphere = sources.SphereSource(registrationGroup="sources", ThetaResolution=16, PhiResolution=32)

      # Create a representation for the sphere proxy and adds it to the render
      # module.
      display = CreateRepresentation(sphere, renModule)

      renModule.StillRender()

    """
    #==============================================================================
    #
    #  Program:   ParaView
    #  Module:    servermanager.py
    #
    #  Copyright (c) Kitware, Inc.
    #  All rights reserved.
    #  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
    #
    #     This software is distributed WITHOUT ANY WARRANTY without even
    #     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    #     PURPOSE.  See the above copyright notice for more information.
    #
    #==============================================================================
    from __future__ import print_function
    import paraview, re, os, os.path, types, sys

    # prefer `vtk` from `paraview` since it doesn't import all
    # vtk modules.
    from paraview import vtk
    from paraview import _backwardscompatibilityhelper as _bc

    from paraview.modules.vtkPVVTKExtensionsCore import *
    from paraview.modules.vtkRemotingCore import *
    from paraview.modules.vtkRemotingServerManager import *
    from paraview.modules.vtkRemotingSettings import *
>   from paraview.modules.vtkRemotingApplication import *
E   ImportError: dlopen(/usr/local/miniconda/envs/test/lib/python3.8/site-packages/paraview/modules/vtkRemotingApplication.so, 2): Library not loaded: @rpath/libicuuc.68.dylib
E     Referenced from: /usr/local/miniconda/envs/test/lib/libvtkRemotingApplication-pv5.9.5.9.dylib
E     Reason: image not found

/usr/local/miniconda/envs/test/lib/python3.8/site-packages/paraview/servermanager.py:60: ImportError

"""

jschueller commented 3 years ago

You're trying to mix non-compatible packages. Paraview from conda-forge requires latest icu 68 while some package in your dependency list probably requires an older. Find out which package pulls an older icu version, then it should be rerendered to catch up with the icu version. I think paraview package is pretty up-to date as the last rerender happened last week, so I'm closing this.