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
I'm trying to use the Vector3 class from PyThreeJS to represent 3D vectors in my Python code, but I keep getting a TypeError when trying to create a new Vector3 object. Here's the relevant code snippet:
When I run this code, I get the following error message:
”“”
TypeError: init() takes from 1 to 3 positional arguments but 4 were given
I have already updated PyThreeJS to the latest version, but the error persists. I'm running Python 3.7.16 on Windows 10.
“”“
Can someone please help me resolve this issue? Thank you in advance for your help!
Steps to reproduce:
Install PyThreeJS using pip install pythreejs
Run the above code snippet
Expected result:
The code should create a new Vector3 object and print its value.
Actual result:
The code raises a TypeError with the message __init__() takes from 1 to 3 positional arguments but 4 were given.
@JagnDC The Vector3 class in pythreejs is a "trait" used with the config system from the traitlets package. It is not mean to be instantiated directly, but rather assigned as a class variable in a HasTraits class. Would you mind explaining what you are trying to do, and why simply using a tree-valued tuple (e.g. (1, 2, 3)) isn't sufficient?
I'm trying to use the Vector3 class from PyThreeJS to represent 3D vectors in my Python code, but I keep getting a TypeError when trying to create a new Vector3 object. Here's the relevant code snippet:
”“”
from pythreejs import Vector3
vec1 = Vector3(1, 2, 3)
print("Vector 1:", vec1)
“”“
When I run this code, I get the following error message:
”“”
TypeError: init() takes from 1 to 3 positional arguments but 4 were given
I have already updated PyThreeJS to the latest version, but the error persists. I'm running Python 3.7.16 on Windows 10.
“”“
Can someone please help me resolve this issue? Thank you in advance for your help!
Steps to reproduce:
Expected result:
Actual result:
Environment:
PyThreeJS version: 2.4.2
Python version: 3.7.16
Operating system: Windows10
The text was updated successfully, but these errors were encountered: