Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
When are imports loaded?
#1
If I have code that imports a couple of libraries I've put together, do they load to memory when the main thread starts, or when there is an actual call to the library?

Reason for asking, .I run my code and the app starts quickly, but there is a quite a pause when the libraries are first actioned.

So if I want an immediate response every time I call a library I have to make a dummy call before my processing actually begins.

Is this correct, or am I missing something about the import commands?

Thanks.
Reply


Messages In This Thread
When are imports loaded? - by MuntyScruntfundle - Feb-10-2019, 12:54 PM
RE: When are imports loaded? - by snippsat - Feb-10-2019, 01:40 PM
RE: When are imports loaded? - by ichabod801 - Feb-10-2019, 03:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is Matplotlib.pyplot Loaded DaveG 2 1,306 Apr-06-2022, 06:12 AM
Last Post: DaveG
  Imports that work with Python 3.8 fail with 3.9 and 3.10 4slam 1 2,585 Mar-11-2022, 01:50 PM
Last Post: snippsat
  Package cannot be loaded into PBS queue file emersonpl 1 1,817 Sep-09-2021, 08:06 PM
Last Post: emersonpl
  PyQt5 MySQL Drivers Not Loaded AdeS 7 5,050 Aug-06-2021, 08:34 AM
Last Post: AdeS
  Imports in my first package cuppajoeman 1 1,942 Jun-28-2021, 09:06 AM
Last Post: snippsat
  script with imports works but pytest gives "ModuleNotFoundError"? Hpao 0 1,560 Jun-27-2021, 08:30 PM
Last Post: Hpao
  Help wanted with python imports petros21 3 2,536 Apr-07-2021, 07:16 PM
Last Post: snippsat
Question How to include Modules not found (conditional imports) in my setup.py when I want to cff 0 3,805 Mar-17-2021, 11:57 AM
Last Post: cff
  MacOS BigSur Python3 - dyld: Library not loaded: trillionanswers 1 4,193 Mar-02-2021, 11:00 PM
Last Post: nilamo
  Why is mpl_toolkits loaded? Gribouillis 1 1,591 Jan-30-2021, 08:39 PM
Last Post: Serafim

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020