Unable to run python files in terminal on Mac
Question:
I create a file and try run it in my terminal and get this error "/Library/Developer/CommandLineTools/usr/bin/python3: can’t open file ‘/Users/dcg/pb’: [Errno 2] No such file or directory"
I’m not sure why, as when I Cd and I’m in the correct directory. This is a my first time coding in python on this laptop. Any help appreciated. Thanks
I tried changing directories, creating new files, restarting pc. Nothing worked. I read online saying apparently its a problem with where python was downloaded.
Answers:
Are you sure to point to the python file you created ?
/Users/dcg/pb
isn’t a python file, you may be missing the .py
extension in your command line prompt.
I create a file and try run it in my terminal and get this error "/Library/Developer/CommandLineTools/usr/bin/python3: can’t open file ‘/Users/dcg/pb’: [Errno 2] No such file or directory"
I’m not sure why, as when I Cd and I’m in the correct directory. This is a my first time coding in python on this laptop. Any help appreciated. Thanks
I tried changing directories, creating new files, restarting pc. Nothing worked. I read online saying apparently its a problem with where python was downloaded.
Are you sure to point to the python file you created ?
/Users/dcg/pb
isn’t a python file, you may be missing the .py
extension in your command line prompt.