ParaView 5.7 doesn't work scipy internal python module

MacOS ParaView 5.6.2

>>> from scipy.spatial import cKDTree

>>>

MacOS ParaView 5.7

from scipy.spatial import cKDTree
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Applications/ParaView-5.7.0.app/Contents/Python/scipy/spatial/__init__.py", line 100, in <module>
    from .qhull import *
ImportError: dlopen(/Applications/ParaView-5.7.0.app/Contents/Python/scipy/spatial/qhull.so, 2): Symbol not found: _main
  Referenced from: /Applications/ParaView-5.7.0.app/Contents/Python/scipy/spatial/qhull.so
  Expected in: flat namespace
 in /Applications/ParaView-5.7.0.app/Contents/Python/scipy/spatial/qhull.so

And I can’t load external scipy module because the internal one exists.

The recent night build ParaView-5.7.0-936-ga45459775a.app:

from scipy.spatial import cKDTree
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Applications/ParaView-5.7.0-936-ga45459775a.app/Contents/Python/scipy/spatial/__init__.py", line 100, in <module>
    from .qhull import *
ImportError: dlopen(/Applications/ParaView-5.7.0-936-ga45459775a.app/Contents/Python/scipy/spatial/qhull.so, 2): Symbol not found: _main
  Referenced from: /Applications/ParaView-5.7.0-936-ga45459775a.app/Contents/Python/scipy/spatial/qhull.so
  Expected in: flat namespace
 in /Applications/ParaView-5.7.0-936-ga45459775a.app/Contents/Python/scipy/spatial/qhull.so

Are you using our release from https://www.paraview.org/download/

Works fine on linux here.

@cory.quammen

MacOS is not equal to Linux. Try MacOS build by your link.

I am able to run from scipy.spatial import cKDTree with the Kitware binaries of 5.7.0.

What version of macOS are you running? Since 5.7 uses the system Python, that could explain the difference. I am running macOS 10.14.6.

MacOS 10.14.6 (18G2022)

ParaView Python Library Path: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7

ParaView Python Library Version: 2.7.16 (default, Oct 16 2019, 00:34:56)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)]

Strange, I have the same Python version and Path on my system.

I don’t know why it is looking for a main function in qhull.so on your system but not mine.

Can you run

/Applications/ParaView-5.7.0.app/Contents/MacOS/paraview -dr

to try running with a default environment and settings?

I uninstalled and installed ParaView 5.7 again and the issue is the same and it’s not depends of PYTHONPATH env variable:

unset PYTHONPATH; /Applications/ParaView-5.7.0.app/Contents/MacOS/paraview -dr

from scipy.spatial import cKDTree

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Applications/ParaView-5.7.0.app/Contents/Python/scipy/spatial/__init__.py", line 100, in <module>
    from .qhull import *
ImportError: dlopen(/Applications/ParaView-5.7.0.app/Contents/Python/scipy/spatial/qhull.so, 2): Symbol not found: _main
  Referenced from: /Applications/ParaView-5.7.0.app/Contents/Python/scipy/spatial/qhull.so
  Expected in: flat namespace
 in /Applications/ParaView-5.7.0.app/Contents/Python/scipy/spatial/qhull.so

Thanks for trying. Thoughts, @ben.boeckel?

Maybe the issue is not so important if we will have soon ParaView 5.8 with Python 3:

Very strange. I don’t know what would cause it to happen on one machine and not another, sorry. Looking for main is very odd (macOS mangling involves putting a leading _ on symbols).