“语法错误:生成器表达式必须加括号";尝试使用 conda 时 [英] "SyntaxError: Generator expression must be parenthesized" when trying to use conda

查看:29
本文介绍了“语法错误:生成器表达式必须加括号";尝试使用 conda 时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

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

推荐答案

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

In my case, pip3 uninstall conda solved the problem.

原因是 miniconda 试图使用 pip 的可执行文件.当我首先使用 pip3 然后使用 miniconda 安装 conda 时发生了这种情况.

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

这篇关于“语法错误:生成器表达式必须加括号";尝试使用 conda 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆