2026/07/09(木) [n年前の日記]
#2 [python] opencv-pythonをインストールした
ちょっと実験をしたくて、Windows11 x64 25H2 + Python 3.10.10 x64上で、opencv関係のモジュールをインストールした。既に入っていたけれど最新版にアップデート。
numpyのバージョンが変わってしまって、他のモジュールに影響を与えてしまった…。
numba をアップデートしたら、numpy 2.2 も利用できる状態になった。
python -m pip uninstall opencv-python opencv-python-headless -y python -m pip install opencv-python opencv-python-headless opencv-contrib-python -U
numpyのバージョンが変わってしまって、他のモジュールに影響を与えてしまった…。
RROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pgzero 1.2.1 requires pygame~=2.0, which is not installed. rembg 2.0.59 requires opencv-python-headless, which is not installed. numba 0.60.0 requires numpy<2.1,>=1.22, but you have numpy 2.2.6 which is incompatible.
- rembg が opencv-python-headless を要求する。
- numba が特定のバージョンの numpy を要求する。
numba をアップデートしたら、numpy 2.2 も利用できる状態になった。
python -m pip install numba -U
> py --version Python 3.10.10 > py -m pip list | grep opencv opencv-contrib-python 5.0.0.93 opencv-python 5.0.0.93 opencv-python-headless 5.0.0.93 > py -m pip list | grep numba numba 0.66.0
[ ツッコむ ]
以上です。