Skip to content
Discussion options

You must be logged in to vote

I don't think this is possible in general as importing a Python module can execute arbitrary code, so there is most likely no easy fix.

As this does depend on the specific module in question, you could start with trying to find out what exactly is taking too long. Some Linux distributions try to improve load times by shipping pre-compiled byte code (.pyc files, c.f. https://docs.python.org/3/library/py_compile.html) but that only helps if the time is actually spent parsing source code into byte code.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@adamreichold
Comment options

Answer selected by Omicronlawful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants
Converted from issue

This discussion was converted from issue #3191 on May 29, 2023 12:42.