thieu1995/opfunu

[BUG]: python 3.12 import failed

huhanyu opened this issue · 6 comments

Description of the bug

python 3.12 import opfunu
from . import cec_based
from .cec2005 import *
from opfunu.cec_based.cec import CecBenchmark
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
how to fix it ?

Steps To Reproduce

python3.12
import opfunu
error!

Additional Information

No response

@huhanyu ,
that is not a right way to use this library.
You should make sure that you install "opfunu", and then just call the class that represent the function you want to use.
Please read the documentation. https://opfunu.readthedocs.io/en/latest/

@huhanyu,

Sorry for the first oversight, I have tested with Github Action on python 3.12. It turned out some how the setuptools is broken in python 3.12. So for now we only support 3.7<= python < 3.12 version.

thank you,i got it!

I don't think python 3.12 is broken. You just need add setuptools as a dependency.

https://docs.python.org/3/whatsnew/3.12.html#distutils

@ncopa ,

Thanks for suggesting solution bro.

@huhanyu,

Sorry for the first oversight, I have tested with Github Action on python 3.12. It turned out some how the setuptools is broken in python 3.12. So for now we only support 3.7<= python < 3.12 version.对不起,第一次疏忽,我已经在 python 3.12 上使用 Github Action 进行了测试。事实证明,setuptools 在 python 3.12 中是如何被破坏的。所以目前我们只支持 3.7<= python < 3.12 版本。

I am currently unable to install opfunu on Python 3.12. can you lift this restriction? this issue can be fixed by follow comment. thank you!

I don't think python 3.12 is broken. You just need add setuptools as a dependency.我不认为 python 3.12 被破坏了。您只需要添加 setuptools 作为依赖项即可。

https://docs.python.org/3/whatsnew/3.12.html#distutils

@thieu1995