0

I thought all I had to do was add things to my path and pythonpath but MAC os still cannot find Python when I do a ./myfile.py etc...

my .zshrc:

export PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:/opt/homebrew/bin:$PATH"
PYTHONPATH="/Library/Frameworks/Python.framework/Versions/3.8/bin"
export PYTHONPATH

But nothing I can source .zshrc or open a new terminal to be sure and if I say:

./myfile.py

I get the error:

env: python: No such file or directory

Do I have to also alias python to python3???

Codejoy
  • 67
  • 3
  • 13
  • I think your file may have the wrong shebang – Marco Zink Aug 23 '22 at 19:59
  • It had no shebang, but I fixed it by having a sym link: ln -s /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 /usr/local/bin/python probably stupid on my part but was not obvious and took some hunting, I will leave this here incase it helps someone else do it faster. – Codejoy Aug 23 '22 at 20:15

0 Answers0