-1

I'm on MacOS Sierra and have python3 and python installed via brew. Using the command python3 -m venv my_venv, I created a vitual environment for python3. I then tried to activate it with . bin/activate.fish from within my_venv. However I get the exception

$(...) 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'

Also I tried to install flake8 for the my_venv with the command (from within my_venv) . bin/pip -m pip install flake8. That also failed with

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'

What is going on and how do I fix it? Just to repeat I run Fish Shell as my default shell.

Napoleon
  • 879
  • 2
  • 14
  • 36
  • Haven't permission or wrong path identification. – dsgdfg Sep 22 '16 at 08:49
  • This seems to be a bug in virtualenv. `$()` isn't (and never was) valid fish syntax, yet it's in the fish script. Please try to report it there. – faho Sep 22 '16 at 15:42

1 Answers1

0

. bin/pip -m pip install flake8.

Here you are sourcing (the . command is an alias for source) the pip script with fish. Since pip is a python script, you'll get syntax errors.

You want ./bin/pip.

$(...) is not supported. In fish, please use '(automate_stuff)'.

This is a bug in virtualenv - $() isn't valid fish syntax.

faho
  • 14,470
  • 2
  • 37
  • 47