2

I'm having a problem with my python installation, it was working fine. I'm not even sure what the cause of the problem is.

I keep getting the following error when I run any python related command on command line:

Error:

    Fatal Python error: Py_Initialize: can't initialize sys standard streams
    Traceback (most recent call last):
      File "/Users/nkosana/.pyenv/versions/3.4.2/lib/python3.4/io.py", line 52, in <module>
      File "/Users/nkosana/.pyenv/versions/3.4.2/lib/python3.4/abc.py", line 3

        ^
    SyntaxError: invalid character in identifier
    Abort trap: 6
5
  • Which OS are you using? Commented Dec 9, 2015 at 16:20
  • What does python --version report? Any chance the python version and libraries are mismatched? Commented Dec 9, 2015 at 16:21
  • El Capitan version 10.11.1 Commented Dec 9, 2015 at 16:41
  • @Fatalerror the version is Python 3.4.2, not sure I have not installed python version recently Commented Dec 9, 2015 at 16:43
  • The error message is claiming that abc.py, line 3 is corrupt. Take a look at it. Commented Dec 9, 2015 at 17:49

1 Answer 1

1

I had the same problem trying to use Python 3 in an environment that already had python2 basically what I realized in my case is that the python3 tried to import materials python2.

My solution was to unset $PYTHONPATH

Sign up to request clarification or add additional context in comments.

2 Comments

Then don't or format this as an answer. You are allowed to be wrong when you answer.
I had the same problem trying to use Python 3 in an environment that already had python2 basically what I realized in my case is that the python3 tried to import materials python2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.