Speeding up the python “import” loader

后端 未结 5 1398
逝去的感伤
逝去的感伤 2020-12-14 17:49

I\'m getting seriously frustrated at how slow python startup is. Just importing more or less basic modules takes a second, since python runs down the sys.path looking for m

5条回答
  •  甜味超标
    2020-12-14 18:11

    Something's missing from your premise--I've never seen some "more-or-less" basic modules take over a second to import, and I'm not running Python on what I would call cutting-edge hardware. Either you're running on some seriously old hardware, or you're running on an overloaded machine, or either your OS or Python installation is broken in some way. Or you're not really importing "basic" modules.

    If it's any of the first three issues, you need to look at the root problem for a solution. If it's the last, we really need to know what the specific packages are to be of any help.

提交回复
热议问题