ImportError: cannot import name _thread
File "...\dateutil\rrule.py", line 16, in
from six.moves import _thread
`python-dateutil` 2.8.0+ 依賴 `six` 模組,但 `six` 版本過舊或安裝損壞,導致 `six.moves._thread` 缺失。Python 2.7 中 `_thread` 模組名為 `thread`,`six` 應提供相容層。
pip install --upgrade six
pip install --upgrade python-dateutil
pip install "python-dateutil<2.8.0" "six>=1.12.0"
python -c "import six; print(six.__version__); from six.moves import _thread; print('OK')"
升級 `six` 與 `python-dateutil` 通常可解決,但**長遠必須遷移至 Python 3**,避免相依性地獄與安全風險。