niklas2902 / py4godot

Python scripting for Godot. This GDExtension plugin allows you to use Python like GDScript, accessing the Godot engine's features and benefiting from Python's vast ecosystem.
MIT License
64 stars 7 forks source link

Fails to add custom python packages under Linux #76

Closed Necrorez closed 3 weeks ago

Necrorez commented 4 weeks ago

I'm experiencing an issue when trying to install and use Python packages (Debian 11, Debian 12, Arch) (specifically numpy) in a Godot 4.3 project. I followed the steps from the "Installing packages for python" documentation, but I encountered the following error when attempting to use numpy:

ImportError: Error importing numpy: you should not try to import numpy from
    its source directory; please exit the numpy source tree, and relaunch
    your python interpreter from there.

Error Traceback:

File "/mnt/storage/projects/test/new-game-project/addons/py4godot/cpython-3.12.4-linux64/python/lib/python3.12/site-packages/numpy/_core/__init__.py", line 23, in <module>
  from . import multiarray
File "/mnt/storage/projects/test/new-game-project/addons/py4godot/cpython-3.12.4-linux64/python/lib/python3.12/site-packages/numpy/_core/multiarray.py", line 10, in <module>
  from . import overrides
File "/mnt/storage/projects/test/new-game-project/addons/py4godot/cpython-3.12.4-linux64/python/lib/python3.12/site-packages/numpy/_core/overrides.py", line 8, in <module>
  from numpy._core._multiarray_umath import (
ImportError: /mnt/storage/projects/test/new-game-project/addons/py4godot/cpython-3.12.4-linux64/python/lib/python3.12/site-packages/numpy/_core/_multiarray_umath.cpython-312-x86_64-linux-gnu.so: undefined symbol: PyObject_SelfIter

Other packages seem to work. But numpy is one of the most essential (OpenCV, Pandas, SciPy, scikit-learn). Also I've tried all the possible releases. Building from source also fails on my machines.

Necrorez commented 3 weeks ago

Works with the numpy fix. Thanks.

niklas2902 commented 3 weeks ago

Hey, thank you for checking the release. Sorry for not being as active latetly