I'm learning python and I'm attempting to make a python file executable. This is the code
#! /Users/<me>/PycharmProjects/untitled3 print ("Hello World") in the terminal I typed.
$ chmod +x paperclip.py And then
$ ./paperclip.py But I get
-bash: ./paperclip.py: /Users/<me>/PycharmProjects/untitled3: bad interpreter: Permission denied How do I fix this? Thanks.
Edit: Even after I changed the top line to
#!/Users/<me>/PycharmProjects/untitled3 python or
#! /Users/<me>/PycharmProjects/untitled3 python3 Never mind. Thanks
#! /usr/bin/env pythoninstead?#! /usr/bin/env python3would likely be more appropriate since you're wanting Python 3 instead of the default Python 2. You can create a symlink if it's not already done by following the steps in this answer.#!/usr/bin/pythonto use the OS X system python or a path to the interpreter you wish to use -- not the script path