The wrong python interpreter is called

前端 未结 6 571

I updated my python interpreter, but I think the old one is still called. When I check for the version I get:

$ python -V
Python 3.0.1

But

6条回答
  •  余生分开走
    2020-12-30 08:41

    According to the first line of the script, #!/usr/bin/python, you are calling the Python interpreter at /usr/bin/python (which is most likely the one that ships with Mac OS X). You have to change that path to the path where you installed your Python 3 interpreter (likely /usr/local/bin/python or /opt/local/bin/python); or you can just change that line to read #!/usr/bin/env python, which will call the python listed first in your PATH variable (which seems to be the newer version you installed).

提交回复
热议问题