0

I'm having an issue using Python in my Mac Terminal Shell.

I used Python through Mac Terminal yesterday, but after I worked in Pycharm this morning, there seems to be an issue with my terminal.

Now when I simply write 'python', I receive this message:

zsh: no such file or directory: /usr/local/bin/python3.7

Any help, getting me back to using Python in my terminal would be appreciated!

jvarela
  • 3,744
  • 1
  • 22
  • 43
Jazz Sami
  • 11
  • 2

2 Answers2

1

Apparently the PATH of your S.O. It can't find the file to launch Python in your terminal so you could:

  1. reinstall Python from the command line (zsh) and validate the "python" command again from the terminal

  2. find the file associated with Python with commands like "find" and then modify the path of the PATH to the path where the Python launcher is

Diego Aaron
  • 386
  • 1
  • 6
  • 19
  • Would this mean I would delete my original python program? And to find that file, would I be running that command in the terminal? – Jazz Sami Jul 21 '20 at 14:30
  • It is what it seems, but nothing that googling "how to reinstall Python on Mac, does not solve" @Jazz Sami – Diego Aaron Jul 21 '20 at 15:10
0

Pycharm has a tendency of changing your PATH after installation.

You have basically 3 options:

Option 1: Reinstall Python and use the path for both pycharm and zsh

I recommend this. It's a little bit of work, but you have a messy situation right now and completely kicking python off the system and then setting the PATH in your bash_profile and Pycharm is cleaner than the other options.

  1. Uninstall Python. Make sure not to touch MacOS system Python.

  2. Install Python

  3. Path in Pycharm

Option 2: Find the path, Pycharm uses and set it in your bashprofile

See 1.3.

Option 3: Install Python and run it separately to the python path pycharm uses.

See 1.2

blkpingu
  • 1,556
  • 1
  • 18
  • 41