Skip to content

TypeError when using Vector3 class #401

Open
@JagnDC

Description

@JagnDC

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:

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.

Environment:

PyThreeJS version: 2.4.2
Python version: 3.7.16
Operating system: Windows10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions