Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"SyntaxError: Generator expression must be parenthesized" when trying to use conda

I'm facing this problem whenever I'm trying to access any anaconda command. In fact, when I try to open my virtual environment it's showing there too

I have re-installed my anaconda navigator but still no result

C:\Users\Gagan Singh>activate tensorflow1
Traceback (most recent call last):
  File "c:\users\gagan singh\appdata\local\programs\python\python37\lib\site-packages\conda\common\configuration.py", line 30, in <module>
    from cytoolz.dicttoolz import merge
ModuleNotFoundError: No module named 'cytoolz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\gagan singh\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\gagan singh\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Gagan Singh\AppData\Local\Programs\Python\Python37\Scripts\conda.exe\__main__.py", line 5, in <module>
  File "c:\users\gagan singh\appdata\local\programs\python\python37\lib\site-packages\conda\cli\__init__.py", line 8, in <module>
    from .main import main  # NOQA
  File "c:\users\gagan singh\appdata\local\programs\python\python37\lib\site-packages\conda\cli\main.py", line 46, in <module>
    from ..base.context import context
  File "c:\users\gagan singh\appdata\local\programs\python\python37\lib\site-packages\conda\base\context.py", line 18, in <module>
    from ..common.configuration import (Configuration, MapParameter, PrimitiveParameter,
  File "c:\users\gagan singh\appdata\local\programs\python\python37\lib\site-packages\conda\common\configuration.py", line 35, in <module>
    from .._vendor.toolz.functoolz import excepts
  File "c:\users\gagan singh\appdata\local\programs\python\python37\lib\site-packages\conda\_vendor\toolz\functoolz.py", line 467
    f.__name__ for f in reversed((self.first,) + self.funcs),
    ^
SyntaxError: Generator expression must be parenthesized
like image 305
Gagandeep Singh Avatar asked Jul 23 '19 07:07

Gagandeep Singh


1 Answers

In my case, pip3 uninstall conda solved the problem.

The reason was miniconda trying to use pip's executables. It happened when I installed conda using pip3 first and then using miniconda.

like image 88
Артём Ощепков Avatar answered Nov 10 '22 11:11

Артём Ощепков