Common command line issues¶
Installing software on the command line involves a lot of trust that you're cutting and pasting things correctly, and that the computer is doing what it should be doing. Usually this involves a lot of careful reading of web pages and shell output that you don't understand, so it's easy to end up in less-than-perfect situations!
- I don't understand any of these words! It's okay (and totally normal), just focus on the ones you do understand. Mark anything that you'd like more explanation about with Hypothesis.
- I don't know what I'm cutting and pasting into terminal! Yyyyyeah, that's going to be very very very common for the rest of your career. Mark them with Hypothesis if you'd like a more thorough explanation.
- I don't know if it worked! If the terminal doesn't say anything, it probably did work. If it says "error" somewhere it probably didn't work. It's like a mean boss that withholds approval and only exists to dole out punishment.
- Is this an error??? It's usually only an error if it says error! If it says warning you're probably okay.
Issue: Command prompt isn't doing anything¶
Sometimes you'll end up in a situation where the command isn't doing anything. You hit enter, you type some commands, and just... nothing. There are three options:
- Everything is working great
- It's waiting for you to type something but you don't realize it
- It's busy doing something
While we try to solve a few situations below, the most common reason this happens is because you just typed
python and pressed enter. No
--version after it, no file after it, just
python. This puts you into a mode called a "REPL" that runs Python code one-by-one, which is almost never what you want to do.
You can recognize you're in the REPL if you see
>>> every time you press enter, or if you get Python-y error messages. You can escape the Python REPL by typing
How can you tell which one it is?
If every time you hit enter it says
soma@MacBook-Air Desktop % or something that seems like it's talking about your computer, you're probably fine. In this case it not printing anything means "nothing broke, so I'm just quietly doing what you asked." This is common with lines that include
~/.zshrc. They're just adding things to your shell startup file and don't feel the need to tell you things worked out.
If every time you hit enter it says something like
dquote > or
>>> (or something just a blank space
), it's probably hoping for more input from you. Maybe you accidentally told it you were going to be running some Python code, or started a
" but forgot to close it. Try pressing
Ctrl+C or typing
If you hit enter again and again and again and nothing shows up, it also might be working hard at processing something. Read the most recent output, if it's something like "Building wheel from source package..." then you probably just have to wait until it's done.
Issue: Not sure if I have zsh or bash¶
My video How to fix bash_profile/PATH not working in OS X Catalina Terminal by using zshrc instead is technically about upgrading to Catalina, but it gives a walkthrough of what bash and z shell are.
PATH is not being updated¶
What is the PATH on the command line, and how do I change it? (OS X only). Requires that you've set up the
code command in VS Code.