I was trying to install Python3, and Sublime Text 3 in order to learn and run Python. Unfortunately, I watched some videos on youtube and tried to follow their instructions, I did something with my Terminal and now it does not work at all. Please explain and show me how to fix it!

In Terminal it shows:

Last login: Sun May  1 18:44:16 on ttys000
Lances-MacBook-Pro:~ lancedang$ touch
-bash: touch: command not found
Lances-MacBook-Pro:~ lancedang$ python
-bash: python: command not found
Lances-MacBook-Pro:~ lancedang$ python3
-bash: python3: command not found
  • Please add the youtube video links or at least the instructions you followed. – klanomath May 2 '16 at 2:07
  • It is Terminal that doesn't work or Python? – Allan May 2 '16 at 2:12
  • The terminal does not work – LDbunny May 2 '16 at 2:12
  • I saw someone has the same problem and they add this: PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin It work after I add that but just for temporary, after I quit and reopen, I have them same problem – LDbunny May 2 '16 at 2:14
  • Type echo $PATH and paste the results. – Allan May 2 '16 at 2:22

Your PATH environment variable seems to have been changed somewhere.

Type the following command at your Terminal prompt:

echo 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/bin:$PATH' >> ~/.bash_profile

Exit terminal and the shell by typing exit and closing the Terminal app. Relaunch.

Everything should be working now.

  • 1
    I added ~/bin:$PATH to it, so it will keep his Python working. – Andrew Larsson May 2 '16 at 2:41
  • @AndrewLarsson It works, Thanks a lot!!! Also can you please show me how can I link the sublime text 3 to run python3, I am really new with python3 – LDbunny May 2 '16 at 2:45
  • @LDbunny I'd suggest heading over to Stack Overflow for questions about Sublime Text. They'd be able to help you better. – Andrew Larsson May 2 '16 at 2:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .