尝试使用 conda 时出现“SyntaxError: Generator expression must be括号”

Gag*_*ngh 6 python syntax-error conda

每当我尝试访问任何 anaconda 命令时,我都会面临这个问题。事实上,当我尝试打开我的虚拟环境时,它也在那里显示

我已经重新安装了我的 anaconda 导航器,但仍然没有结果

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
Run Code Online (Sandbox Code Playgroud)

小智 2

就我而言,pip3 uninstall conda解决了问题。

原因是 miniconda 试图使用 pip 的可执行文件。当我先安装condausingpip3然后使用 miniconda 时,就发生了这种情况。