Skip to content

python3.10 windows wheel silently depend on numpy>=1.22 #102101

@jvesely

Description

@jvesely

🐛 Describe the bug

PS C:\> ~\AppData\Local\Microsoft\WindowsApps\python3.10.exe -m venv .\test-venv
PS C:\> .\test-venv\Scripts\Activate.ps1
(test-venv) PS C:\> pip install numpy==1.21.6
Collecting numpy==1.21.6
  Using cached numpy-1.21.6-cp310-cp310-win_amd64.whl (14.0 MB)
Installing collected packages: numpy
Successfully installed numpy-1.21.6

[notice] A new release of pip is available: 23.0.1 -> 23.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip
(test-venv) PS C:\> pip install torch --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu 
Looking in indexes: https://download.pytorch.org/whl/nightly/cpu
Collecting torch
  Downloading https://download.pytorch.org/whl/nightly/cpu/torch-2.1.0.dev20230523%2Bcpu-cp310-cp310-win_amd64.whl (17
4.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 174.6/174.6 MB 4.5 MB/s eta 0:00:00
Collecting jinja2
  Downloading https://download.pytorch.org/whl/nightly/Jinja2-3.1.2-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB 4.0 MB/s eta 0:00:00
Collecting networkx
  Downloading https://download.pytorch.org/whl/nightly/networkx-3.0rc1-py3-none-any.whl (2.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 25.8 MB/s eta 0:00:00
Collecting fsspec
  Downloading https://download.pytorch.org/whl/nightly/fsspec-2023.4.0-py3-none-any.whl (153 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 154.0/154.0 kB 2.3 MB/s eta 0:00:00
Collecting typing-extensions
  Downloading https://download.pytorch.org/whl/nightly/typing_extensions-4.4.0-py3-none-any.whl (26 kB)
Collecting sympy
  Downloading https://download.pytorch.org/whl/nightly/sympy-1.11.1-py3-none-any.whl (6.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.5/6.5 MB 27.6 MB/s eta 0:00:00
Collecting filelock
  Downloading https://download.pytorch.org/whl/nightly/filelock-3.9.0-py3-none-any.whl (9.7 kB)
Collecting MarkupSafe>=2.0
  Downloading https://download.pytorch.org/whl/nightly/MarkupSafe-2.1.2-cp310-cp310-win_amd64.whl (16 kB)
Collecting mpmath>=0.19
  Downloading https://download.pytorch.org/whl/nightly/mpmath-1.2.1-py3-none-any.whl (532 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 532.6/532.6 kB 34.8 MB/s eta 0:00:00
Installing collected packages: mpmath, typing-extensions, sympy, networkx, MarkupSafe, fsspec, filelock, jinja2, torch
Successfully installed MarkupSafe-2.1.2 filelock-3.9.0 fsspec-2023.4.0 jinja2-3.1.2 mpmath-1.2.1 networkx-3.0rc1 sympy
-1.11.1 torch-2.1.0.dev20230523+cpu typing-extensions-4.4.0

[notice] A new release of pip is available: 23.0.1 -> 23.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip
(test-venv) PS C:\> python -c 'import torch; torch.tensor([1,2,3]).numpy()'
<string>:1: UserWarning: Failed to initialize NumPy: module compiled against API version 0xf but this version of numpy
 is 0xe (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84.)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
RuntimeError: Numpy is not available

why 1.21.6? because that's the oldest supported numpy on windows/python3.10:

(test-venv) PS C:\> pip install oldest-supported-numpy
Collecting oldest-supported-numpy
  Using cached oldest_supported_numpy-2022.11.19-py3-none-any.whl (4.9 kB)
Collecting numpy==1.21.6
  Using cached numpy-1.21.6-cp310-cp310-win_amd64.whl (14.0 MB)
Installing collected packages: numpy, oldest-supported-numpy
Successfully installed numpy-1.21.6 oldest-supported-numpy-2022.11.19

[notice] A new release of pip is available: 23.0.1 -> 23.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip

Versions

all

cc @seemethere @malfet

Metadata

Metadata

Assignees

Labels

module: binariesAnything related to official binaries that we release to usersmodule: regressionIt used to work, and now it doesn'ttriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions