[vtkusers] Cannot import python bindings anymore: module 'dl' has no attribute 'RTLD_NOW'

David Gobbi david.gobbi at gmail.com
Fri Sep 22 13:16:33 EDT 2017


Hi Nicolas,

Thanks for reporting this.  The code that is raising the exception should
never be executed under Python 3, since Python 3 doesn't have a "dl" module.

Can you try importing the "dl" and "DLFCN" modules?  Under Python 3, both
should fail to load, and if they do load, then something is wrong and have
to find out where Python is finding them.

For example, under Python 2.7:

 python
 Python 2.7.13 (default, Feb 20 2017, 20:23:30)
 [GCC 4.4.7] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import dl
 >>> print dl.__file__
 /usr/local/lib/python2.7/lib-dynload/dl.so
 >>> import DLFCN
 >>> print DLFCN.__file__
 /usr/local/lib/python2.7/plat-linux2/DLFCN.pyc


But under Python 3, you should see this:

 python3
 Python 3.5.1 (v3.5.1:37a07cee5969, Dec  5 2015, 21:12:44)
 [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import dl
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 ImportError: No module named 'dl'
 >>> import DLFCN
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 ImportError: No module named 'DLFCN'

Let me know what the results are.

 - David


On Fri, Sep 22, 2017 at 10:39 AM, Nicolas Cedilnik <
nicolas.cedilnik at inria.fr> wrote:

> Hello,
>
> Following a reboot after some system updates, I cannot "import vtk"
> anymore:
>
> $ python
>
> Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:51:32)
> [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>
>> import vtk
>>>>
>>> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/opt/ncedilni/miniconda3.6/envs/vtscan/lib/python3.6/site-packages/vtk/__init__.py",
> line 38, in <module>
>     sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
> AttributeError: module 'dl' has no attribute 'RTLD_NOW'
>
> Google wasn't very helpful, so I'm posting here… I'm running Fedora 26,
> python 3.6 binaries with miniconda and vtk 7.1.1 installed from the
> conda-forge repository.
>
> How did I break my VTK install?
>
> Should I file a bug report somewhere?
>
> Thanks for your help,
>
> -- Nicolas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170922/a0b75d72/attachment.html>


More information about the vtkusers mailing list