Can't execute some python commands for virtual env from Fish shell
<p>I'm on MacOS Sierra and have python3 and python installed via brew. Using the command <code>python3 -m venv my_venv</code>, I created a vitual environment for python3. I then tried to activate it with <code>. bin/activate.fish</code> from within <code>my_venv</code>. However I get the exception</p>

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

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

<pre><code>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'
</code></pre>

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

<blockquote>
  <p>. bin/pip -m pip install flake8.</p>
</blockquote>

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

<p>You want <code>./bin/pip</code>.</p>

<blockquote>
  <p>$(...) is not supported. In fish, please use '(automate_stuff)'.</p>
</blockquote>

<p>This is a bug in virtualenv - <code>$()</code> isn't valid fish syntax.</p>

python shell fish