meganz / sdk

MEGA C++ SDK
BSD 2-Clause "Simplified" License
1.33k stars 510 forks source link

Python Bindings distutils depricated #2619

Open AnotherSamWithADream opened 2 years ago

AnotherSamWithADream commented 2 years ago

When building the python bindings after running: ./configure --disable-silent-rules --enable-python --disable-examples I get this error: `configure: error: cannot import Python module "distutils". Please check your Python installation. The error was:

:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives` According to the error you should be using setuptools not distutils. I do not do any C based languages (C, C++, C#) so I wont be able to make the changes.
jorgeajimenezl commented 2 years ago

If you have setuptools installed, use this variable export PYTHONWARNINGS="ignore"

jorgeajimenezl commented 2 years ago

@missemily2022 Even if you have setuptools installed, the configure.sh, what it does is to check that running python -c "import distutils" does not generate output. In recent versions of distutils, this generates a warning, so it does not pass the test, however, using PYTHONWARNINGS="ignore", the interpreter will not generate warnings and should pass the configuration tests.

jorgeajimenezl commented 2 years ago

@jorgeajimenezl Thanks for the Answer.I now need to somehow implement it in GitHub Actions

Well, u can just create a shell script (that export the env variable) that u execute on GitHub Actions