alicec
alicec

Reputation: 59

Cannot run python file on command line with Python 3.8.0; it invokes python interpreter instead

I have a python file, test.py and when I try to run it in Terminal using $ python test.py , it doesn't run as it's supposed to, and invokes python interpreter instead.

I have installed python 3.8.0.

The code in the python file is:

#!/usr/bin/python 
print("Hello World!")

It should print Hello World!

Instead it invokes python interpreter:

$ python test.py 
Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

Upvotes: 0

Views: 885

Answers (1)

sdp
sdp

Reputation: 162

Check the output of which python. It may be an alias of ipython -i or something.

Upvotes: 3

Related Questions