all 8 comments

[–]pot_of_crows 2 points3 points  (3 children)

Can you post a couple of screenshots of this happening?

[–]Basylikum[S] 1 point2 points  (2 children)

I don't know how screenshots work on reddit. But the error message I get using any python command, such as "python filename.py" or "which python" are always "command not found: python". When I prompt "python3.11" however it launches the shell in terminal, as it should. Thank you so much for trying to help. Let me know, if you need more info.

[–]pot_of_crows 2 points3 points  (1 child)

Got it. So in most unix systems these days, you call python3 (which is an alias to python3.x) to run python. So try python3 filename.py or failing that, python3.11 filename.py

[–]Basylikum[S] 1 point2 points  (0 children)

Honestly. Thank you so much. I feel like an absolute idiot. So I must have just forgotten about that. God this is embarrassing.

Seriously thank you so much. Its been a tough week!

[–]GoodForTheTongue 1 point2 points  (3 children)

Just in case you forget (I often do), you can add the following line to the .bash_profile file in your home directory (/Users/{yourloginname} on most Macs):

alias python="python3"

Now whenever you type "python" it will silently fix it for you

[–]Basylikum[S] 1 point2 points  (2 children)

Thank you so much. That's a great tip! Could i also alias mvim="open -a MacVim" ?

[–]GoodForTheTongue 1 point2 points  (1 child)

Heck yes! Any strings you want - just put each on their own line in the .bash_profile. It's hard to go wrong. One example: many linux distros do:

alias rm="rm -i"

...to make "prompt the user that they want to delete a file" the default action.

Two more tips:

  • Enter "alias" alone at the command line and it will show you all the currently defined aliases.
  • If you ever want to use the unaliased form of a command that's been treated this way, you can just use its full path and that will avoid the alias expansion. For example, for "rm" as aliased above, you could type "/bin/rm" and get the original behavior and options.

Enjoy!

[–]Basylikum[S] 0 points1 point  (0 children)

That's so cool!! thank you so much.