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

David Gobbi david.gobbi at gmail.com
Sat Sep 23 09:11:01 EDT 2017


Hi Nicholas,

>From Python 3.3 onward, the __init__.py isn't needed in order for a
directory to be considered a module, see PEP 420 -- Implicit Namespace
Packages:
https://www.python.org/dev/peps/pep-0420/

So it isn't really a bug, maybe it's more of an unwanted feature?

As far as VTK is concerned, we can remove the use of "dl" from our
__init__.py since it's irrelevant for Python 2.7 and Python 3.x.

 - David


On Sat, Sep 23, 2017 at 2:03 AM, Nicolas Cedilnik <nicolas.cedilnik at inria.fr
> wrote:

> Hello,
>
> Thanks for helping.
>
> 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.
>>
> The first one imports but I can't figure out where from, and the second
> one doesn't import.
>
> $ ipython
> Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:51:32)
> Type 'copyright', 'credits' or 'license' for more information
> IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.
>
> In [1]: import dl
>
> In [2]: dl.__file__
> ------------------------------------------------------------
> ---------------
> AttributeError                            Traceback (most recent call
> last)
> <ipython-input-2-b1226f8e7c87> in <module>()
> ----> 1 dl.__file__
>
> AttributeError: module 'dl' has no attribute '__file__'
>
> In [3]: import DLFCN
> ------------------------------------------------------------
> ---------------
> ModuleNotFoundError                       Traceback (most recent call
> last)
> <ipython-input-3-fa2771fe0f81> in <module>()
> ----> 1 import DLFCN
>
> ModuleNotFoundError: No module named 'DLFCN'
>
> I've checked if something named dl was in my variable $PYTHONPATH folders,
> but it isn't the case.
>
> I do have a ~/dl folder though, and the problem disappears if I rename it
> or don't launch the interpreter from the ~ folder. This is weird because
> there's not ~/dl/__init__.py or ~/dl.py
>
> I'm not sure whether this is VTK or python bug, but I've found a
> workaround: launch the interpreter from somewhere else than my homedir.
>
> Cheers,
>
>
> -- Nicolas
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensou
> rce/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170923/957d68b5/attachment.html>


More information about the vtkusers mailing list