-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] optree on Windows on ARM64 #182
Comments
Hi @ozanMSFT, thanks for raising this. But I cannot reproduce your error in a fresh # % PanXuehai @ Windows-ARM64 in ~ [20:26:05]
$ python3.13 -m venv venv
# % PanXuehai @ Windows-ARM64 in ~ [20:26:21]
$ & .\venv\Scripts\Activate.ps1
(optree )
# % PanXuehai @ Windows-ARM64 in ~ [20:26:26]
$ pip3 install -U pip setuptools wheel build ipython
...
(optree )
# % PanXuehai @ Windows-ARM64 in ~\Projects [20:27:56]
$ pip3 install optree
Collecting optree
Downloading optree-0.13.1-cp313-cp313-win_amd64.whl.metadata (48 kB)
Requirement already satisfied: typing-extensions>=4.5.0 in c:\users\panxuehai\projects\optree\venv\lib\site-packages (from optree) (4.12.2)
Downloading optree-0.13.1-cp313-cp313-win_amd64.whl (293 kB)
Installing collected packages: optree
Successfully installed optree-0.13.1
(optree )
# % PanXuehai @ Windows-ARM64 in ~ [20:28:07]
$ ipython Python 3.13.1 (tags/v3.13.1:0671451, Dec 3 2024, 19:06:28) [MSC v.1942 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.31.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import optree
In [2]: optree.__version__
Out[2]: '0.13.1'
In [3]: import platform
In [4]: platform.system()
Out[4]: 'Windows'
In [5]: platform.uname()
Out[5]: uname_result(system='Windows', node='Windows-ARM64', release='11', version='10.0.26100', machine='ARM64')
In [6]: platform.python_version()
Out[6]: '3.13.1'
In [7]: platform.python_implementation()
Out[7]: 'CPython'
In [8]: import sys
In [9]: sys.implementation
Out[9]:
namespace(name='cpython',
cache_tag='cpython-313',
version=sys.version_info(major=3, minor=13, micro=1, releaselevel='final', serial=0),
hexversion=51184112) |
I see |
Thanks for the reply @XuehaiPan Based on the logs you've provided, I'm seeing that it is downloading
However, it should download optree-0.13.1-cp313-cp313-win_arm64.whl It might be because of some caching in your environment. Could you please clear your pip cache or use following command:
It should print:
I'm using Python 3.12.8 |
I have tried a new fresh environment with Python 3.12. It still installs the wheel with the tag # % PanXuehai @ Windows-ARM64 in ~ [20:46:14]
$ mkdir test
Directory: C:\Users\PanXuehai
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2025/1/14 20:46 test
# % PanXuehai @ Windows-ARM64 in ~ [20:46:16]
$ cd test
# % PanXuehai @ Windows-ARM64 in ~\test [20:46:17]
$ python3.12 -m venv venv
# % PanXuehai @ Windows-ARM64 in ~\test [20:46:31]
$ & .\venv\Scripts\Activate.ps1
(test )
# % PanXuehai @ Windows-ARM64 in ~\test [20:46:37]
$ pip3 install -U pip setuptools wheel build ipython
...
(test )
# % PanXuehai @ Windows-ARM64 in ~\test [20:47:28]
$ pip3 cache purge
Files removed: 116
(test )
# % PanXuehai @ Windows-ARM64 in ~\test [20:47:35]
$ pip3 install optree --no-cache-dir
Collecting optree
Downloading optree-0.13.1-cp312-cp312-win_amd64.whl.metadata (48 kB)
Collecting typing-extensions>=4.5.0 (from optree)
Downloading typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Downloading optree-0.13.1-cp312-cp312-win_amd64.whl (292 kB)
Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Installing collected packages: typing-extensions, optree
Successfully installed optree-0.13.1 typing-extensions-4.12.2
(test )
# % PanXuehai @ Windows-ARM64 in ~\test [20:47:46]
$ ipython
Python 3.12.8 (tags/v3.12.8:2dc476b, Dec 3 2024, 19:30:04) [MSC v.1942 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.31.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import optree
In [2]: optree.__version__
Out[2]: '0.13.1'
In [3]: import platform
In [4]: platform.uname()
Out[4]: uname_result(system='Windows', node='Windows-ARM64', release='11', version='10.0.26100', machine='ARM64')
In [5]: import sys
In [6]: sys.implementation
Out[6]:
namespace(name='cpython',
cache_tag='cpython-312',
version=sys.version_info(major=3, minor=12, micro=8, releaselevel='final', serial=0),
hexversion=51120368) |
I think problem might be also related to your this is your output:
this is Windows ARM64 output:
Please try to install: |
If you download the ARM64 wheel file and unzip it, the C extension is tagged with (test )
# % PanXuehai @ Windows-ARM64 in ~\test [20:51:10] C:1
$ wget https://files.pythonhosted.org/packages/80/34/d1b1849a6240385c4a3af5da9425b11912204d0b1cf142d802815319b73a/optree-0.13.1-cp313-cp313-win_arm64.whl
--2025-01-14 20:53:44-- https://files.pythonhosted.org/packages/80/34/d1b1849a6240385c4a3af5da9425b11912204d0b1cf142d802815319b73a/optree-0.13.1-cp313-cp313-win_arm64.whl
Connecting to 127.0.0.1:7890... connected.
Proxy request sent, awaiting response... 200 OK
Length: 293670 (287K) [application/octet-stream]
Saving to: 'optree-0.13.1-cp313-cp313-win_arm64.whl'
optree-0.13.1-cp313-cp313-win_arm64.whl 100%[===================================================================================================================>] 286.79K 819KB/s in 0.4s
2025-01-14 20:53:44 (819 KB/s) - 'optree-0.13.1-cp313-cp313-win_arm64.whl' saved [293670/293670]
(test )
# % PanXuehai @ Windows-ARM64 in ~\test [20:56:18]
$ wheel unpack --dest .\sitedir .\optree-0.13.1-cp313-cp313-win_arm64.whl
Unpacking to: sitedir\optree-0.13.1...OK
(test )
# % PanXuehai @ Windows-ARM64 in ~\test [20:56:52]
$ Get-ChildItem .\sitedir\optree-0.13.1\optree\
Directory: C:\Users\PanXuehai\test\sitedir\optree-0.13.1\optree
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2025/1/14 20:56 integration
-a--- 2025/1/14 20:56 5821 __init__.py
-a--- 2025/1/14 20:56 550400 _C.cp313-win_amd64.pyd
-a--- 2025/1/14 20:56 5520 _C.pyi
-a--- 2025/1/14 20:56 14851 accessor.py
-a--- 2025/1/14 20:56 18313 dataclasses.py
-a--- 2025/1/14 20:56 6831 functools.py
-a--- 2025/1/14 20:56 149248 ops.py
-a--- 2025/1/14 20:56 0 py.typed
-a--- 2025/1/14 20:56 31663 registry.py
-a--- 2025/1/14 20:56 18684 typing.py
-a--- 2025/1/14 20:56 3455 utils.py
-a--- 2025/1/14 20:56 1880 version.py |
Maybe related:
I installed the Python ARM64 build. I renamed the file extension in site-packages and I got: In [1]: import _C
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import _C
ImportError: DLL load failed while importing _C: %1 is not valid Win32 application |
Required prerequisites
What version of OpTree are you using?
0.13.1
System information
Installation:
pip
(please check problem description)Python: 3.12.8 (Windows ARM64)
Platform: Windows ARM64
Optree Version:
0.13.1
Problem description
Windows ARM64 version of
optree
has a problem onimport
.optree-0.13.1-cp313-cp313-win_arm64.whl
If you install it with regular command (by wheel file):
or to prevent any cache
If you install it via source code (Visual Studio C++ Build Tools are installed in system):
or
It is successfully being installed and working without any problem.
Reproducible example code
Traceback
Expected behavior
It should
import optree
without any problem.Additional context
Most probably there is a problem on generation of Windows ARM64 wheel.
Until fixing the issue, as a workaround, you might also consider to remove
optree-0.13.1-cp313-cp313-win_arm64.whl
from wheel list to force build on Windows ARM64.The text was updated successfully, but these errors were encountered: