ここには、Ubuntu24 にインストールした、Siril 1.4.0で Python を使うメモと案内があります。
Python仮想環境を指定して、活性化させSirilを起動すると、Siril Pythonモジュールがインストールされ、Pythonスクリプトが使えます。
Python-Tkをインストールする必要もあるかもしれません。
pip と venv を使って仮想環境にパッケージをインストールする
pip と venv を使って仮想環境にパッケージをインストールする
https://packaging.python.org/ja/latest/guides/installing-using-pip-and-virtual-environments/
ここを参考にして、Ubuntu24 に入れた Siril仮想環境を指定する。
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt install python3.12-venv
You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.
Failing command: /home/USERNAME/.local/share/siril/venv/bin/python3
$ sudo apt install python3.12-venv
log: python仮想環境を準備しています: /home/USERNAME/.local/share/siril/venv.
log: pythonモジュールが最新か確認しています...
log: Installing / updating python module in the background. This may take a few seconds...
/home/USERNAME/.local/share/siril/venv/bin/python3: No module named pip
log: Warning: unable to install or update the Siril python module.
$ python3 -m venv /home/USERNAME/.local/share/siril/venv
もしくは、貴方のSirilインストールディレクトリを指定しましょう。
Siril仮想環境にパッケージをインストールして使えるように、仮想環境を “activate” させます。
$ source /home/USERNAME/.local/share/siril/venv/bin/activate
(venv) USERNAME@HOSTNAME:~/.local/share/siril/venv$
pipを最新版にします。
(venv) USERNAME@HOSTNAME:$ python3 -m pip install --upgrade pip
(venv) USERNAME@HOSTNAME:$ python3 -m pip --version
Sirilを起動すると、以下のlogが表示されました。
Initializing FFTW multithreading support...
log: Welcome to siril v1.4.0-beta2
途中省略
log: Preparing python virtual environment: /home/USERNAME/.local/share/siril/venv.
途中省略
Last available version: 1.4.0-beta1
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting numpy>=1.20.0 (from sirilpy==0.6.8)
Downloading numpy-2.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (62 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.0/62.0 kB 1.3 MB/s eta 0:00:00
Collecting packaging>=21.0 (from sirilpy==0.6.8)
Downloading packaging-25.0-py3-none-any.whl.metadata (3.3 kB)
Collecting requests>=2.25.0 (from sirilpy==0.6.8)
Downloading requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting charset-normalizer<4,>=2 (from requests>=2.25.0->sirilpy==0.6.8)
Downloading charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (35 kB)
Collecting idna<4,>=2.5 (from requests>=2.25.0->sirilpy==0.6.8)
Downloading idna-3.10-py3-none-any.whl.metadata (10 kB)
Collecting urllib3<3,>=1.21.1 (from requests>=2.25.0->sirilpy==0.6.8)
Downloading urllib3-2.4.0-py3-none-any.whl.metadata (6.5 kB)
Collecting certifi>=2017.4.17 (from requests>=2.25.0->sirilpy==0.6.8)
Downloading certifi-2025.4.26-py3-none-any.whl.metadata (2.5 kB)
Downloading numpy-2.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.1/16.1 MB 24.8 MB/s eta 0:00:00
Downloading packaging-25.0-py3-none-any.whl (66 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.5/66.5 kB 4.2 MB/s eta 0:00:00
Downloading requests-2.32.3-py3-none-any.whl (64 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.9/64.9 kB 6.5 MB/s eta 0:00:00
Downloading certifi-2025.4.26-py3-none-any.whl (159 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 159.6/159.6 kB 13.1 MB/s eta 0:00:00
Downloading charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (148 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 148.6/148.6 kB 12.7 MB/s eta 0:00:00
Downloading idna-3.10-py3-none-any.whl (70 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.4/70.4 kB 5.3 MB/s eta 0:00:00
Downloading urllib3-2.4.0-py3-none-any.whl (128 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 128.7/128.7 kB 11.5 MB/s eta 0:00:00
Building wheels for collected packages: sirilpy
Building wheel for sirilpy (pyproject.toml) ... done
Created wheel for sirilpy: filename=sirilpy-0.6.8-py3-none-any.whl size=99430 sha256=6a7aac0b2f7050cd96f985f7da9f41e5a1d5ae5f60e40f044fa01e839f21631a
Stored in directory: /tmp/pip-ephem-wheel-cache-lz3rs76b/wheels/b6/ee/15/50b9098e72d3de45dba69ef6dc47cd27d9dbf6d6caf2c23ae2
Successfully built sirilpy
Installing collected packages: urllib3, packaging, numpy, idna, charset-normalizer, certifi, requests, sirilpy
Successfully installed certifi-2025.4.26 charset-normalizer-3.4.2 idna-3.10 numpy-2.2.5 packaging-25.0 requests-2.32.3 sirilpy-0.6.8 urllib3-2.4.0
log: Python module is up-to-date
[ttkthemes] インストールできない。。。 Python-Tkが必要です。
ttkthemesとは?
https://pypi.org/project/ttkthemes/
使いたいPythonのバージョンに合わせた python-tk をインストールします。
$ sudo apt install python3.12-tk
次のコマンドでモジュールを入れなくても、Siril Pythonスクリプトを起動させると必要なモジュールが入ります。
$ python3 -m pip install ttkthemes ← これは行わない。Pythonスクリプトを実行する。
Collecting ttkthemes
Using cached ttkthemes-3.2.2.tar.gz (891 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting pillow (from ttkthemes)
Downloading pillow-11.2.1-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (8.9 kB)
Downloading pillow-11.2.1-cp312-cp312-manylinux_2_28_x86_64.whl (4.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.6/4.6 MB 20.7 MB/s eta 0:00:00
Building wheels for collected packages: ttkthemes
Building wheel for ttkthemes (pyproject.toml) ... done
Created wheel for ttkthemes: filename=ttkthemes-3.2.2-cp312-cp312-linux_x86_64.whl size=1794058 sha256=97cf69057ffe06ce204d35dd6d9918030ac6152b15fce05b9d8fbacbade5fb76
Stored in directory: /home/minmin/.cache/pip/wheels/d4/69/04/0666a275c3b5cf4ed1036378c0ab691467df0a47a6379bda53
Successfully built ttkthemes
Installing collected packages: pillow, ttkthemes
Successfully installed pillow-11.2.1 ttkthemes-3.2.2
以下は必要の無い、パッケージでした。
$ python3 -m pip install setuptools
$ python3 -m pip install tkinter
ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none)
$ python3 -m pip install pytk
Successfully installed appdirs-1.4.4 blessed-1.21.0 flyingcircus-0.1.4.1 pytk-0.0.2.1 setuptools-scm-8.3.1 wcwidth-0.2.13
Sirilの使い方などは、
Rich Stevenson – Deep Space Astro
彼の動画を参考にしています。Thank you very much.
彼がリリースした、”DSA-Star_Reduction.py”のソースを見たく、また使うために Python環境を整えるのが目的でした。
“DSA-Star_Reduction.py”では、StarNetとpixel mathを使ってるのですね。
Siril1.4 と Python の組み合わせが楽しくなってきています。
コメント