numbatradingalgorithmic-tradingquantitative-financevectorbt

Vectorbt import hangs on Windows unless Numba JIT is disabled


I’m trying to use vectorbt in Python on Windows, but the import hangs indefinitely:

import vectorbt as vbt  # hangs here

Environment / Versions I’ve tested:

Observations:

import os
os.environ["NUMBA_DISABLE_JIT"] = "1"
import vectorbt  # works, but calculations are slow 

Goal:
I want to import Vectorbt without hanging, while keeping Numba JIT fully enabled for fast computations.

Question:
Why does Vectorbt hang on import?
Is there a way to safely initialize Vectorbt on Windows with full JIT enabled?


Solution

  • After about 8 hours, I finally realized the problem was super simple 😅
    Vectorbt hangs in Jupyter because Numba can’t access its cache folder and I could fix it by setting a writable cache path before import or Run Jupyter as Administrator:

    import os
    os.environ["NUMBA_CACHE_DIR"] = r"C:\temp\numba_cache"
    import vectorbt as vbt