rodrigo-arenas / Sklearn-genetic-opt

ML hyperparameters tuning and features selection, using evolutionary algorithms.
https://sklearn-genetic-opt.readthedocs.io
MIT License
286 stars 73 forks source link

Bug during installation of development dependencies #117

Closed Plutone11011 closed 1 year ago

Plutone11011 commented 1 year ago

System information Windows 10 Scikit-learn version: 1.2.0 Python version: 3.8.5 tensorflow version: 2.11.0 protobuf version: 4.21.12

Problem When I install the dev dependencies using this command pip install -r dev-requirements.txt, the following error appears

ERROR: numba 0.56.4 has requirement numpy<1.24,>=1.18, but you'll have numpy 1.24.1 which is incompatible.
ERROR: sphinx-rtd-theme 1.1.1 has requirement docutils<0.18, but you'll have docutils 0.19 which is incompatible.
ERROR: sphinx-rtd-theme 1.1.1 has requirement sphinx<6,>=1.6, but you'll have sphinx 6.1.2 which is incompatible.
ERROR: tensorboard 2.11.0 has requirement protobuf<4,>=3.9.2, but you'll have protobuf 4.21.12 which is incompatible.
ERROR: tensorflow-intel 2.11.0 has requirement protobuf<3.20,>=3.9.2, but you'll have protobuf 4.21.12 which is incompatible.

This was done on a clean install, without cached packages.

Steps to reproduce

  1. Clone the repo
  2. Create a virtual environment
  3. Delete pip cache
  4. Install the dev requirements

Additional context When I try to run a Sphinx build, this error comes up, which might be related to these versioning bugs

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "c:\users\borel\sklearn-genetic-opt\venv\lib\site-packages\sphinx\config.py", line 351, in eval_config_file
    exec(code, namespace)  # NoQA: S102
  File "C:\Users\borel\Sklearn-genetic-opt\docs\conf.py", line 19, in <module>
    from sklearn_genetic import __version__
  File "C:\Users\borel\Sklearn-genetic-opt\sklearn_genetic\__init__.py", line 1, in <module>
    from .genetic_search import GASearchCV, GAFeatureSelectionCV
  File "C:\Users\borel\Sklearn-genetic-opt\sklearn_genetic\genetic_search.py", line 20, in <module>
    from .algorithms import eaSimple, eaMuPlusLambda, eaMuCommaLambda
  File "C:\Users\borel\Sklearn-genetic-opt\sklearn_genetic\algorithms.py", line 5, in <module>
    from .callbacks.validations import eval_callbacks
  File "C:\Users\borel\Sklearn-genetic-opt\sklearn_genetic\callbacks\__init__.py", line 7, in <module>
    from .loggers import ProgressBar, LogbookSaver, TensorBoard
  File "C:\Users\borel\Sklearn-genetic-opt\sklearn_genetic\callbacks\loggers.py", line 16, in <module>
    import tensorflow as tf
  File "c:\users\borel\sklearn-genetic-opt\venv\lib\site-packages\tensorflow\__init__.py", line 37, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "c:\users\borel\sklearn-genetic-opt\venv\lib\site-packages\tensorflow\python\__init__.py", line 37, in <module>
    from tensorflow.python.eager import context
  File "c:\users\borel\sklearn-genetic-opt\venv\lib\site-packages\tensorflow\python\eager\context.py", line 28, in <module>
    from tensorflow.core.framework import function_pb2
  File "c:\users\borel\sklearn-genetic-opt\venv\lib\site-packages\tensorflow\core\framework\function_pb2.py", line 16, in <module>
    from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
  File "c:\users\borel\sklearn-genetic-opt\venv\lib\site-packages\tensorflow\core\framework\attr_value_pb2.py", line 16, in <module>
    from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
  File "c:\users\borel\sklearn-genetic-opt\venv\lib\site-packages\tensorflow\core\framework\tensor_pb2.py", line 16, in <module>
    from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
  File "c:\users\borel\sklearn-genetic-opt\venv\lib\site-packages\tensorflow\core\framework\resource_handle_pb2.py", line 16, in <module>
    from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
  File "c:\users\borel\sklearn-genetic-opt\venv\lib\site-packages\tensorflow\core\framework\tensor_shape_pb2.py", line 36, in <module>
    _descriptor.FieldDescriptor(
  File "c:\users\borel\sklearn-genetic-opt\venv\lib\site-packages\google\protobuf\descriptor.py", line 560, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 5. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
rodrigo-arenas commented 1 year ago

hi @Plutone11011 I tried to reproduce this error but I got the installation finished successfully on this python version, try to install the requirements like this:

pip install -r dev-requirements.txt --force-reinstall --no-cache-dir

If it still fails, according to your message error, go to the dev-requirements.txt file and in the numpy requirement change it to numpy>=1.18.2,<1.240 Let me know if it helps

rodrigo-arenas commented 1 year ago

I'm closing this issue for now, let me know if you have any more questions related