Skip to main content
2 of 8
added 456 characters in body

PATH on Mac not working for Python

i am trying to run a Python program from my command line on my Mac. (in this case: python3 Hello.py). For the life of it, I can’t get it to consider the PATH where the program is located. This is the error message: /Library/Frameworks/Python.framework/Versions/3.13/Resources/Python.app/Contents/MacOS/Python: can't open file '/Users/user/Hello.py': [Errno 2] No such file or directory. I have changed the /.zshrc file to add the PATH, but it doesn’t work. Here it is: {PATH="/Users/user/mu_code:${PATH}" export PATH}. Are there any resources for me to check out? The path to the file contains an underscore, so I have put the path in “”. Nonetheless it can’t find it.’ If I type in the full path with the program name, it works fine.

Python is also in the path already automatically after installation. Here is the path (its in /.zprofile): {PATH="/Library/Frameworks/Python.framework/Versions/3.13/bin:${PATH}" export PATH}