Running python in powershell crashes
<p>I am learning python from the book <em>Learn Python the Hardway</em>. I tried running python in powershell and python crashes.</p>

<pre class="lang-none prettyprint-override"><code>PS C:\python27&gt;Fatal Python error:
    Py_Initialize: can't initialize sys standard streams
        File ".\lib\encodings\__init__.py, line 123
            raise CodecRegistryError,\
                   ^ SyntaxError: invalid syntax
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
</code></pre>

<p>I have tried reinstalling several versions of python. Please tell me a way to fix this.</p>

<p>I'm assuming here that you have tried using cmd.exe (the command prompt) (which you can run by pressing the windows key + R and then typing cmd). It might be a bug. When I looked at the Python <a href="https://bugs.python.org/issue10920" rel="nofollow">issue trackers</a>, it seems that something like this has happened before. You could try dual-booting Linux, or using <a href="https://www.cygwin.com" rel="nofollow">cygwin</a>, which allows you to use a Linux shell on your Windows machine.</p>

python python-2.7 powershell