What is uqq?

I’m a novice programmer so this is probably a very dumb question (but how else do we learn?). I’m going through the chapters and always notice the first line is !pip install -Uqq fastbook. I have some understanding of what pip does but don’t really understand what the -uqq does. Also, sometimes I see pip and !pip. What’s the exclamation point for and why do I see it sometimes and sometimes not?

Thanks!

1 Like

First concerning !pip vs pip is that the one with the ! mark you can run it inside your Jupiter notebook and run it as a code cell and you can download packages, because if you run it without a ! mark probably you will get an error, because the pip without ! you run it in terminal, so technically there is not difference at a high level it’s just a syntax guide for you if you want to install packages from inside jupyteer notebbok just put !pip install package-name.
Concerning -Uqq fastbook, i also have no idea what it is!

1 Like
  1. pip -Uqq : U means upgrade the package, qq display only the messages with ERROR,CRITICAL log levels .

it’s for upgrading a package and not polluting your output with a lot of text

  1. ! is for running a shell command in Jupyter Notebook (without !, in jupyter you can only run python code)

Hope it helps

10 Likes

Thank you!

Thank you! This is really helpful

Interested to read more about it! Would you possibly lead me towards which language is used here? Is it BASH?

Anything that is executable in your environment, no matter the language

I’m sorry. I assume I was pretty vague. I meant the tag -Uqq which language is this? Is it BASH? Cause it doesn’t seem to be relative to python!

Thank you for answering!

It’s actually written in python. I’ve just checked that pip is 100% python. About the tag Uqq you can take a look at argparse to see how to make similar things: argparse — Parser for command-line options, arguments and sub-commands — Python 3.10.4 documentation

I too was curious about the double q. There’s more details in the pip docs:
-U is explained here: pip install - pip documentation v22.2.1
-qq is explained here: pip - pip documentation v22.2.1

1 Like