2

When I try to import base from deap:

from deap import creator, base, tools

Traceback (most recent call last):

 File ~\AppData\Roaming\Python\Python310\site-packages\IPython\core\interactiveshell.py:3369 in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  Input In [2] in <cell line: 1>
    from deap import creator, base, tools

  File ~\AppData\Roaming\Python\Python310\site-packages\deap\base.py:192
    raise TypeError, ("Both weights and assigned values must be a "
                   ^
SyntaxError: invalid syntax
Beso
  • 1,176
  • 5
  • 12
  • 26
TKrogg19
  • 21
  • 3
  • 2
    That is the Python 2 syntax, and you're trying to run it under Python 3. Looks like a bug in the package to me. You can path this by editing the file and deleting that comma. – Tim Roberts Apr 21 '22 at 18:04
  • 1
    https://github.com/DEAP/deap/pull/591/files#diff-d50863620d1d61c76f24deb3e14f4bd8ce914c860fd8301513d01d37c18fbc1c – CristiFati Apr 21 '22 at 18:09

0 Answers0