You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> rye run python
>>> import numpy
Traceback (most recent call last):
File "D:\work\temp\rye-test3\.venv\lib\site-packages\numpy\_core\__init__.py", line 23, in <module>
from . import multiarray
File "D:\work\temp\rye-test3\.venv\lib\site-packages\numpy\_core\multiarray.py", line 10, in <module>
from . import overrides
File "D:\work\temp\rye-test3\.venv\lib\site-packages\numpy\_core\overrides.py", line 8, in <module>
from numpy._core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy._core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\work\temp\rye-test3\.venv\lib\site-packages\numpy\__init__.py", line 128, in <module>
from numpy.__config__ import show as show_config
File "D:\work\temp\rye-test3\.venv\lib\site-packages\numpy\__config__.py", line 4, in <module>
from numpy._core._multiarray_umath import (
File "D:\work\temp\rye-test3\.venv\lib\site-packages\numpy\_core\__init__.py", line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.10 from "D:\work\temp\rye-test3\.venv\Scripts\python.exe"
* The NumPy version is: "2.1.2"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy._core._multiarray_umath'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\work\temp\rye-test3\.venv\lib\site-packages\numpy\__init__.py", line 133, in <module>
raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
If you force a sync with rye sync -f, or even if you delete the .venv directory and sync again with rye sync, it still installs the wrong version.
Expected Result
I expect the correct version of numpy to be installed.
If the order is changed between rye pin and rye add numpy, I could get expected behavior:
When I deleted the project directory (the parent directory of .venv) and then recreated a directory with the same name in the same location, I was able to reproduce the issue as follows:
Steps to Reproduce
After installing numpy, if you change the Python version, rye continues to install the wrong version of numpy.
To initialize a project, follow the steps below:
Rye still installs the wrong numpy version:
If you force a sync with
rye sync -f
, or even if you delete the.venv
directory and sync again withrye sync
, it still installs the wrong version.Expected Result
I expect the correct version of numpy to be installed.
If the order is changed between
rye pin
andrye add numpy
, I could get expected behavior:Actual Result
You can confirm that the wrong version is installed by checking the following directory:
Although the Python version is 3.10, the numpy distribution for Python 3.12 is mistakenly installed.
Version Info
rye 0.41.0
commit: 0.41.0 (10d691d 2024-09-29)
platform: windows (x86_64)
self-python: [email protected]
symlink support: false
uv enabled: true
Stacktrace
No response
The text was updated successfully, but these errors were encountered: