[vtkusers] Import time in Python

Andras Lasso lasso at queensu.ca
Thu Aug 18 10:32:22 EDT 2016

While we are at it, a few additional notes related to this.

It is better not to use the path environment variable (PATH) to specify DLL search paths and generally this method is not used for Windows applications. The simplest solution is to put all DLLs in the same directory as the executable file is . There are a few more complex alternative methods using delay-loaded libraries or manifests.

If you chose to add directories to PATH then you always have to _replace_ the old PATH or _prepend_ your directories, due to more important reasons than just loading time:

1. Other applications might have added directories to PATH that contains similar DLLs as you are looking for. Those similar DLLs may be loaded instead of yours if you add your directories to the end.

2. Long environment variables may be truncated. If you try to append your directories to the end then they might not be effectively added.

Applications usually do not need to load anything from the extra directories listed in PATH (since system, C runtime libraries, etc. are not found using PATH) and you can simply replace PATH with the list of directories your application needs to load DLLs from.

Always use a launcher to set application-specific environment variables (a batch file or a tool such as http://www.commontk.org/index.php/Tools:_Application_launcher).


-----Original Message-----
From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Cory Quammen
Sent: August 18, 2016 9:11
To: Andrea Borsic <aborsic at ne-scientific.com>
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Import time in Python

> In my experience this is not uncommon on (modern) Windows computers if 
> many installed applications have added their paths to the system path 
> in front of the VTK DLLs path. Windows will test many directories 
> searching for the DLLs it needs to load.

That is a very useful thing to know. Thanks for sharing!


Cory Quammen
R&D Engineer
Kitware, Inc.
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/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:

More information about the vtkusers mailing list