Extremely Slow Import in Conda Environments (torch / torchvision / cupy / PyMuPDF, etc.) with Almost Zero CPU/Disk Usage

Hello, I am encountering an unusual and severe performance problem when using Conda environments on my system. I would greatly appreciate help from the community to determine whether this issue is related to my CPU (Ultra 7 265K) or something else in my environment.


:wrench: My System Configuration

  • CPU: Intel Ultra 7 265K

  • GPU: NVIDIA RTX 5060 Ti

  • RAM: 32 GB

  • Storage: NVMe SSD

  • OS: Windows 11 23H2

  • Conda: Fresh installation of both Anaconda and Miniconda (issue occurs on both)


:snake: Problem Description

In brand-new Conda environments, I encounter the following:

  1. First-time imports of certain libraries are extremely slow, including:

    • torch

    • torchvision

    • cupy

    • PyMuPDF

    • (possibly other large packages)

    :stopwatch: The initial import takes several minutes to over ten minutes.

  2. If I terminate Python and wait more than ~10 minutes, the imports become slow again

    • If I re-import immediately (within ~1 minute) after the first import, the import is fast (less than 1 second).

    • But if I wait longer (10+ minutes), the import slows down again dramatically. Importing libraries like OS, sys, and numpy is running smoothly.

  3. During these slow imports, CPU usage is near 0%, and disk activity is also near 0%
    This does not look like normal compilation, I/O, or cache-building behavior.

  4. On another machine with the same OS and similar configuration, everything works normally:

    Reference machine:

    • CPU: Intel 14650

    • GPU: RTX 4060

    • RAM: 32 GB

    • OS: Windows 11 23H2

    → Imports are always fast on this machine.
    The exact same code, same Conda environment, same package versions.


:puzzle_piece: What I Have Already Tried (none resolved the issue)

  • Reinstalled Anaconda / Miniconda

  • Created multiple fresh environments

  • Tried different versions of PyTorch and CUDA

  • Updated GPU drivers

  • Cleared __pycache__ and Conda caches

  • Disabled antivirus (including Windows Defender)

  • Checked Windows Indexing

  • Verified SSD health

  • Disabled Windows Real-Time Protection and Core Isolation

  • Used python -v to trace imports → shows stalls but no clear reason

The issue persists across all attempts.


:red_question_mark: My Questions

Could this be related to the Intel Ultra 7 265K architecture or compatibility with Python/Conda?
Under what circumstances would Python show:

  • extremely slow first-time imports

  • very low CPU usage

  • almost no disk I/O

Is there any known compatibility issue with this CPU series (Meteor Lake / Intel Ultra)?

I am unsure whether this is:

  • a CPU architecture issue

  • some Windows security mechanism

  • a Conda/Python dynamic library loading issue

  • filesystem or signature verification issue

  • or something else entirely


:folded_hands: Any help is greatly appreciated!

I can provide additional data if needed:

  • python -v import logs

  • Process Monitor traces

  • Conda environment details

  • System event logs

Thank you in advance — I’m really hoping to identify the root cause of this unusual behavior.

Thanks everyone for the insights.
I want to post the final explanation and solution, in case other users encounter the same issue.


:magnifying_glass_tilted_left: Root Cause Identified: Network-Based Reputation / Security Verification Blocked by Campus Firewall

After repeated tests, I discovered that the extremely slow first-time import of packages such as torch, torchvision, cupy, PyMuPDF, etc., was not related to Conda, Python, or my hardware.

The root cause turned out to be:

Windows’ DLL reputation / security verification being blocked by my campus network firewall.

Here’s what happened:

  • When Python imports large packages for the first time, it loads many DLLs.

  • Windows performs online reputation checks / security validation for these DLLs (SmartScreen + Cloud-based Protection).

  • My campus network has strict firewall rules, which caused these online checks to hang indefinitely.

  • During this time:

    • CPU = 0%

    • Disk = 0%

    • import takes several minutes to more than ten minutes

    • no visible error messages

This exactly matched the behavior of SmartScreen or Windows Defender waiting for remote validation that never completes.


:wrench: How I Confirmed the Issue

When I disconnected the internet:

  • Imports became fast immediately.

When I connected to a different network (mobile hotspot):

  • First-time imports became normal.

After this successful check, switching back to the original network:

  • The imports remained fast, because the reputation/cache was already stored locally.

This confirmed that initial DLL reputation checks were blocked by my campus network, and once they passed once, Windows cached the results.


:hammer_and_wrench: Working Solution

Two things helped solve the issue permanently:

:check_mark: 1. Connect to a different network once

(e.g., mobile hotspot)
→ Allow Windows to complete initial DLL reputation checks
→ Results get cached locally
→ No more slow imports afterward

and/or

:check_mark: 2. Disable SmartScreen reputation checks

Windows Security → App & Browser Control → Reputation-based protection settings
Disable:

  • Check apps and files

  • SmartScreen for Microsoft Edge

  • SmartScreen for Microsoft Store apps

  • (and any other SmartScreen-related options)

After this, Python imports became consistently fast even on the campus network.


:tada: Final Result

  • The issue had nothing to do with Conda

  • Not caused by Intel Ultra 7 265K, GPU, Python, or package versions

  • The slowdown was caused by Windows online reputation scanning being blocked by firewall

  • Once verification succeeded ONCE, everything became normal


:raising_hands: Hope this helps others

If your Python imports are:

  • extremely slow only on the first import

  • CPU/disk activity near zero

  • and the machine is connected to a restricted network

then the issue may be caused by:

Windows SmartScreen / Defender cloud-based scanning blocking DLL validation

The workaround is either:

  1. Try a different network once, or

  2. Disable Reputation-based protection.