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:
Python: 3.9, 3.10, 3.11, 3.12, 3.13 (all 64-bit)
NumPy: 1.2 , 2.3
Numba: 0.58 → 0.63
vectorbt: latest
Observations:
The import hangs regardless of NumPy, Numba, or Python version.
It only works if I disable Numba JIT:
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?
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