Use python3
to run python3
, and also restart your shell after modifying .bash_profile
or do source .bash_profile
to load the new settings without restarting the shell.
$ which python3
/usr/bin/python3
Example:
$ cat so.py
#!/usr/bin/python3
print("hello, world!")
$ chmod +x so.py
$ ./so.py
hello, world!