Skip to content
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: detect buggy windows version and raise at import #17553

Closed
wants to merge 4 commits into from

Conversation

mattip
Copy link
Member

@mattip mattip commented Oct 14, 2020

xref gh-16744. Use a check at import to make sure we are not sensitive to the fmod bug in windows. Alternative to gh-17547.

@bashtage could you check if these PRs works as advertised?

@bashtage
Copy link
Contributor

Does what it says.

In [1]: import numpy as np
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-1-0aa0b027fcb6> in <module>
----> 1 import numpy as np

c:\anaconda\envs\python-pip\lib\site-packages\numpy\__init__.py in <module>
    374
    375     if sys.platform == "win32" and sys.maxsize > 2**32:
--> 376         _win_os_check()
    377
    378     del _mac_os_check

c:\anaconda\envs\python-pip\lib\site-packages\numpy\__init__.py in _win_os_check()
    371                    "See this issue for more information "
    372                    "https://developercommunity.visualstudio.com/content/problem/1208774/fpu-exception-in-fmod0-x-in-windows-10-version-200.html")
--> 373             raise RuntimeError(msg.format(__file__)) from None
    374
    375     if sys.platform == "win32" and sys.maxsize > 2**32:

RuntimeError: The current Numpy installation ('c:\\anaconda\\envs\\python-pip\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information https://developercommunity.visualstudio.com/content/problem/1208774/fpu-exception-in-fmod0-x-in-windows-10-version-200.html

numpy/__init__.py Outdated Show resolved Hide resolved
numpy/__init__.py Outdated Show resolved Hide resolved
mattip and others added 2 commits October 14, 2020 13:27
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Oct 14, 2020
@bashtage
Copy link
Contributor

Maybe you need to make the exception more explicit?

numpy/__init__.py Outdated Show resolved Hide resolved
@mattip
Copy link
Member Author

mattip commented Oct 14, 2020

@bashtage if you could try it again that would be great. There were various typos and mistakes in the original version.

@bashtage
Copy link
Contributor

@mattip Still does the job.

@pv
Copy link
Member

pv commented Oct 21, 2020

Maybe this is OK to merge, even if also gh-17547 gets in? Import-time sanity check probably can't hurt, in case similar bug gets reintroduced in another Windows update.

@mattip mattip added the triage review Issue/PR to be discussed at the next triage meeting label Oct 21, 2020
@mattip
Copy link
Member Author

mattip commented Oct 29, 2020

Since OpenBLAS 0.3.12 avoids using the messed-up registers, this check is no longer relevant. Closing.

@mattip mattip closed this Oct 29, 2020
@charris charris reopened this Oct 29, 2020
_win_os_check()

del _win_os_check

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are some hard tabs in here.

msg = ("The current Numpy installation ({!r}) fails to "
"pass a sanity check due to a bug in the windows runtime. "
"See this issue for more information "
"https://developercommunity.visualstudio.com/content/problem/1208774/fpu-exception-in-fmod0-x-in-windows-10-version-200.html")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2004, not 200?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL is correct, despite missing the 4.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVM.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used "https://tinyurl.com/y3dm3h86" instead.

@mattip mattip removed the triage review Issue/PR to be discussed at the next triage meeting label Nov 4, 2020
@wonkodv
Copy link

wonkodv commented Nov 7, 2020

Hi, I came here from a pip installation that is refusing to work now, looking for a workaround, but did not find anything.

Am I correct in saying, that this is not a problme on 32 bit python?

If so, I would ask you to change the error message so that it links to this wiki page I just made instead of to the visual studio bugtracker.

https://github.com/numpy/numpy/wiki/FMod-Bug-on-Windows

@bashtage
Copy link
Contributor

bashtage commented Nov 7, 2020

You are correct that there is no issue on 32 but windows. The best workarounds are to either use WSL or 32 bit. Neither has the fmod bug.

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Nov 14, 2020
@mattip mattip closed this Dec 17, 2020
@mattip mattip deleted the issue16744 branch April 8, 2021 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants