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

float128 not supported on my Windows Anaconda #1511

Closed
vtomole opened this issue Apr 9, 2019 · 11 comments
Closed

float128 not supported on my Windows Anaconda #1511

vtomole opened this issue Apr 9, 2019 · 11 comments
Assignees

Comments

@vtomole
Copy link
Collaborator

vtomole commented Apr 9, 2019

Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.array([1,1,1],dtype=np.float128)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'numpy' has no attribute 'float128'
>>>

@c-poole I ran into this while running pytest on my Windows. Does pytest pass for you on Windows?

@vtomole
Copy link
Collaborator Author

vtomole commented Apr 9, 2019

This seems to be a win32 bug: winpython/winpython#613

Edit: Based on comprehending the linked issue, it's not a winpython error at all. Suggestion is to use np.longdouble in place of np.float128. This defaults to float64 on my Windows and np.float128 on Linux.

@vtomole
Copy link
Collaborator Author

vtomole commented Apr 9, 2019

I suggest we replace np.float128 with np.longdouble and np.complex256 with np.clongdouble. These won't change anything on Linux but it will give us np.float64 and np.complex128 on Windows and won't break tests on Windows builds (this change also depends on how many devs we have on Windows ).

Kind of related: @Strilanc Should we add a Windows build on our Travis?

@LuisM78
Copy link

LuisM78 commented Jun 12, 2020

Hi, Is there a solution for this problem? I am using Windows 10. can you please point me to the right install for numpy?
Thanks,
Luis

@vtomole
Copy link
Collaborator Author

vtomole commented Jun 12, 2020

We already solved this; by not using float128. What commands are you getting to run into this error?

@LuisM78
Copy link

LuisM78 commented Jun 12, 2020

Hi, I am using in a function.
def softmax(x):
x = np.array(x, dtype=np.float128)
e_x = np.exp(x)
return e_x / e_x.sum(axis=0)

I have np version 1.15.4

@vtomole
Copy link
Collaborator Author

vtomole commented Jun 12, 2020

The snippet you posted doesn't use Cirq.

@LuisM78
Copy link

LuisM78 commented Jun 12, 2020

yes, sorry...
I couldn't figure out how to do it in Windows. So I switched to an Ubuntu virtual box and created a python environment with the specific pip requirements and versions ... and problem solved...
Thank you!
Luis

@hafez-ahmad
Copy link

any support for windows 10 and python 3.8, I am getting the same error.
AttributeError: module 'numpy' has no attribute 'float128'

@balopat
Copy link
Contributor

balopat commented Sep 22, 2020

@hafez-ahmad can you share the code you're using where you're running into this using Cirq?

@hafez-ahmad
Copy link

@balopat here it is josuemtzmo/trackeddy#9

@vtomole
Copy link
Collaborator Author

vtomole commented Sep 22, 2020

@hafez-ahmad That code doesn't use Cirq.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants