Sirilの仮想環境で、PyTorchや関連パッケージのインストール時にエラーが発生する。
SyQon Starless スクリプトを起動させると以下のエラー
: PyQt6 is installed
: PySide6 is installed
: astropy is installed
: scipy is installed
: Installing PyTorch with backend: intel
: Installing: torch torchvision intel-extension-for-pytorch
: Looking in indexes: https://download.pytorch.org/whl/xpu
: Collecting torch
: Using cached torch-2.13.0%2Bxpu-cp312-cp312-win_amd64.whl.metadata (40 kB)
: Collecting torchvision
: Using cached torchvision-0.28.0%2Bxpu-cp312-cp312-win_amd64.whl.metadata (5.7 kB)
: ERROR: Could not find a version that satisfies the requirement intel-extension-for-pytorch (from versions: none)
: ERROR: No matching distribution found for intel-extension-for-pytorch
: Failed to install PyTorch: Command '['C:\\Users\\USERNAME\\AppData\\Local\\siril\\venv\\Scripts\\python.exe', '-m', 'pip', 'install', 'torch', 'torchvision', 'intel-extension-for-pytorch', '--index-url', 'https://download.pytorch.org/whl/xpu']' returned non-zero exit status 1.
: Error installing Torch: Command '['C:\\Users\\USERNAME\\AppData\\Local\\siril\\venv\\Scripts\\python.exe', '-m', 'pip', 'install', 'torch', 'torchvision', 'intel-extension-for-pytorch', '--index-url', 'https://download.pytorch.org/whl/xpu']' returned non-zero exit status 1.
: Traceback (most recent call last):
: File "C:\Users\USENAME\AppData\Local\siril-scripts\SyQon/Starless.py", line 108, in <module>
: import torch
: ModuleNotFoundError: No module named 'torch'
: Python process (PID: 10120) exited with status 1
: Python communication worker finished...
この春から夏は曇って、星空が見られないので、SirilやGUN/Linuxばかり弄ってます。
軽量版のCPU専用(whl/cpu)を入れ、Disable GPUで行う方法
Sirilの仮想環境(venv)を有効化
cmd
C:\Users\USERNAME\AppData\Local\siril\venv\Scripts\activate.bat
pip自体をアップデート
python -m pip install --upgrade pip
CPU専用PyTorchをインストール
エラーの原因だったIntel拡張パッケージを無視し、余計なGPU用ライブラリを除外したCPU版を上書きします。
–dry-run オプションでインストールした際の振る舞いを確認します。
python -m pip install torch torchvision --index-url https://download.pytorch.org/whl --dry-run
python -m pip install torch torchvision --index-url https://pytorch.org --dry-run
Looking in indexes: https://pytorch.org
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu --dry-run
Would install Jinja2-3.1.6 MarkupSafe-3.0.3 filelock-3.32.3 fsspec-2026.7.0 mpmath-1.3.0 networkx-3.6.1 pillow-12.3.0 setuptools-78.1.0 sympy-1.14.0 torch-2.13.0+cpu torchvision-0.28.0+cpu
Successfully installed MarkupSafe-3.0.3 filelock-3.32.3 fsspec-2026.7.0 jinja2-3.1.6 mpmath-1.3.0 networkx-3.6.1 pillow-12.3.0 setuptools-78.1.0 sympy-1.14.0 torch-2.13.0+cu132 torchvision-0.28.0+xpu ###← xpuが入っちゃった場合は削除
### torchvision-0.28.0+xpu ← xpuが入っちゃった場合は削除
python -m pip uninstall torch torchvision
python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu --force-reinstall
Successfully installed MarkupSafe-3.0.3 filelock-3.32.3 fsspec-2026.7.0 jinja2-3.1.6 mpmath-1.3.0 networkx-3.6.1 numpy-2.5.2 pillow-12.3.0 setuptools-78.1.0 sympy-1.14.0 torch-2.13.0+cpu torchvision-0.28.0+cpu typing-extensions-4.16.0
動作確認テスト
python -c "import torch; print('PyTorch Version:', torch.__version__)
仮想環境を終了
Successfully installed…が出たら、環境を終えます
deactivate
Intel Iris Xe環境
xpuを入れるらしいが、試していない。
Sirilの仮想環境(venv)を有効化(アクティベート)
cmd
C:\Users\USERNAME\AppData\Local\siril\venv\Scripts\activate.bat
pip自体をアップデートし、古い依存関係が残らないよう、念のため仮想環境内のpipを最新にします。
cmd
python -m pip install –upgrade pip
エラー原因を省いたPyTorchのみの強制再インストール問題を引き起こしていた intel-extension-for-pytorch の指定を完全に省き、ログで正常に掴めていた Intel XPU 対応の PyTorch 本体のみを上書き配置します。
cmd
python -m pip install torch torchvision –index-url https://download.pytorch.org/whl/xpu –dry-run
python -m pip install torch torchvision –index-url https://download.pytorch.org/whl/xpu –force-reinstall
動作確認テスト
cmd
python -c “import torch; print(‘PyTorchバージョン:’, torch.version); print(‘XPU利用可能か:’, torch.xpu.is_available() if hasattr(torch, ‘xpu’) else ‘非対応’)”

コメント