<ul dir="auto">
<li>VSCode Version: 0.10.11</li>
<li>OS Version: OS X El Capitan 10.11.4</li>
<li>Node Version: 5.10.1</li>
</ul>
<p dir="auto">Steps to Reproduce:</p>
<ol dir="auto">
<li>Launch code from terminal <code class="notranslate">code .</code>. It fails with the following error -</li>
</ol>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="File &quot;&lt;string&gt;&quot;, line 1
import os,sys; print os.path.realpath(sys.argv[1])
                          ^
SyntaxError: invalid syntax
/usr/local/bin/code: line 10: ./MacOS/Electron: No such file or directory"><pre class="notranslate">File <span class="pl-s"><span class="pl-pds">"</span>&lt;string&gt;<span class="pl-pds">"</span></span>, line 1
import os,sys<span class="pl-k">;</span> print os.path.realpath(sys.argv[1])
                          ^
SyntaxError: invalid syntax
/usr/local/bin/code: line 10: ./MacOS/Electron: No such file or directory</pre></div>
<p dir="auto">It used to work perfectly alright before the OS X upgrade to 10.11.4. Just to be sure, I uninstalled code from PATH and installed it again through command palette but no luck.</p>
<p dir="auto">Just installed 0.10.10 and installed the <code class="notranslate">code</code> shell command:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ code --help
  File &quot;&lt;string&gt;&quot;, line 1
    import os,sys; print os.path.realpath(sys.argv[1])
                          ^
SyntaxError: invalid syntax
/usr/local/bin/code: line 10: ./MacOS/Electron: No such file or directory"><pre class="notranslate"><code class="notranslate">$ code --help
  File "&lt;string&gt;", line 1
    import os,sys; print os.path.realpath(sys.argv[1])
                          ^
SyntaxError: invalid syntax
/usr/local/bin/code: line 10: ./MacOS/Electron: No such file or directory
</code></pre></div>
<p dir="auto">VS Code itself works fine if I launch it via Spotlight.</p>
<p dir="auto">I believe the problem is that I had a Python virtual environment active, and <code class="notranslate">python</code> points to Python 3. If I try <code class="notranslate">code</code> outside of that virtualenv, where <code class="notranslate">python</code> means Python 2, everything works fine.</p>
<p dir="auto">I guess the options are:</p>
<ol dir="auto">
<li>Make the launch script Python 2/3 compatible. (Step one would probably be to add <code class="notranslate">from __future__ import print_function</code> and update the <code class="notranslate">print</code> statements accordingly.)</li>
<li>Do some extra work to guarantee that you launch the system Python and not the user's configured Python, though this is probably not a viable long-term approach since distributions like Fedora now <a href="https://fedoraproject.org/wiki/Changes/Python_3_as_Default" rel="nofollow">default to Python 3</a> and don't even install Python 2 by default.</li>
</ol>