Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Windows load error #7

Open
ccjalal opened this issue Jul 25, 2017 · 4 comments
Open

Windows load error #7

ccjalal opened this issue Jul 25, 2017 · 4 comments

Comments

@ccjalal
Copy link

ccjalal commented Jul 25, 2017

I get the following error on trying to run from windows and python 3.

Traceback (most recent call last):
File "cube_interactive.py", line 46, in
class Cube:
File "cube_interactive.py", line 77, in Cube
for theta in (np.pi / 2, -np.pi / 2)]
File "cube_interactive.py", line 77, in
for theta in (np.pi / 2, -np.pi / 2)]
NameError: name 'x' is not defined

@davidwhogg
Copy link
Owner

The only thing I know how to do is shine the @jakevdp symbol.

@jakevdp
Copy link
Collaborator

jakevdp commented Jul 31, 2017

That's quite strange because x is defined on line 76, right above where the error says it's undefined.

@hs309
Copy link

hs309 commented Dec 23, 2017

I found out that the code worked with 2.7 but had the issue with Python 3.6. Have you guys solved the problem?

@hs309
Copy link

hs309 commented Dec 27, 2017

@jakevdp @davidwhogg @ccjalal
Solved. The issue occurred due to the difference between Python 2 and 3.

Solution:
File "cube_interactive.py", lines 76-79

rots = [Quaternion.from_v_theta(x, theta)
        for theta in (np.pi / 2, -np.pi / 2)]
rots += [Quaternion.from_v_theta(y, theta)
         for theta in (np.pi / 2, -np.pi / 2, np.pi, 2 * np.pi)]

=>
rots = [Quaternion.from_v_theta(x, np.pi / 2)]
rots += [Quaternion.from_v_theta(x, -np.pi / 2)]

for theta in (np.pi / 2, -np.pi / 2, np.pi, 2 * np.pi):
    rots += [Quaternion.from_v_theta(y, theta)]

File projection.py, line 160
trans = range(1, dproj.ndim) + [0] => trans = list(range(1, dproj.ndim)) + [0]

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

No branches or pull requests

4 participants