【发布时间】:2016-09-22 08:22:41
【问题描述】:
我在 MacOS Sierra 上并通过 brew 安装了 python3 和 python。使用命令python3 -m venv my_venv,我为python3 创建了一个虚拟环境。然后我尝试在my_venv 中使用. bin/activate.fish 激活它。但是我得到了例外
$(...) is not supported. In fish, please use '(automate_stuff)'.
bin/activate.fish (line 58): if test -n "$(automate_stuff) "
^
from sourcing file bin/activate.fish
called on line 175 of file /usr/local/Cellar/fish/HEAD/share/fish/config.fish
in function '.'
called on standard input
source: Error while reading file 'bin/activate.fish'
我还尝试使用命令(来自 my_venv). bin/pip -m pip install flake8 为 my_venv 安装 flake8。这也失败了
Missing end to balance this if statement
bin/pip (line 9): if __name__ == '__main__':
^
from sourcing file bin/pip
called on line 175 of file /usr/local/Cellar/fish/HEAD/share/fish/config.fish
in function '.'
called on standard input
source: Error while reading file 'bin/pip'
发生了什么,我该如何解决?再说一遍,我将 Fish Shell 作为我的默认 shell 运行。
【问题讨论】:
-
没有权限或路径标识错误。
-
这似乎是 virtualenv 中的一个错误。
$()不是(也从来不是)有效的鱼语法,但它在鱼脚本中。请尝试在那里报告。