libtcod / python-tcod

A high-performance Python port of libtcod. Includes the libtcodpy module for backwards compatibility with older projects.
BSD 2-Clause "Simplified" License
404 stars 37 forks source link

Issue with libtcod importing NDArray from numpy.typing when it should just be importing ndarray from numpy. #115

Closed deeredman1991 closed 2 years ago

deeredman1991 commented 2 years ago

libtcod tries to do

from numpy.typing import NDArray

and I believe what it's meaning to do is

from numpy import ndarray

as a result it causes an error and crashes on import.

I attached an image of my CLI

Untitled

As you can see from the CLI; I ran pip install tcod and I am using python 3.7.6 on windows.

HexDecimal commented 2 years ago

The issue is more that the requirements are too old. numpy.typing.NDArray is a Numpy 1.21 feature and is not the same as numpy.ndarray. You should upgrade your Numpy installation.

HexDecimal commented 2 years ago

NumPy dropped support of Python 3.7. So the latest versions require Python 3.8 or later. You should still be able to get NumPy 1.21.x which is what the CI tests have been apparently using.

deeredman1991 commented 2 years ago

That did it! Thank you very much!