0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

`pip install "numpy==1.26"`はnumpy 1.26の最も大きいバージョンでなく最も小さいバージョンがインストールされる

Posted at

環境

  • Python 3.12.1
  • pip 24.1.1

numpy 1.26のバージョン

image.png

内容

numpy 1.26の最新バージョンをインストールしたくて、以下のコマンドを実行しました。

$ pip install numpy==1.26

$ python -c "import numpy; print(numpy.__version__)"
1.26.0

しかし、numpyのバージョンは1.26.4ではなく1.26.0でした。
バージョン1.26の最新をインストールする場合は、以下のように上限を指定する必要があります。

$ pip install "numpy<1.27"

$ python -c "import numpy; print(numpy.__version__)"
1.26.4

poetryで利用できるCaret requirementsという記法(例:numpy = "^1.26")に慣れてしまい、numpy==1.26は1.26の最新バージョンがインストールされることを期待してしまいました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?