How do you install python packages? (AI) Flashcards

(8 cards)

1
Q

What is the standard tool for installing Python packages?

A

pip (often recursively defined as “Pip Installs Packages”). It’s the Python package installer and is included with modern Python distributions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the most basic command to install a package named requests?

A

pip install requests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What command do you use to install a specific version of a package, like version 1.5 of pandas?

A

pip install pandas==1.5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you upgrade an already installed package (e.g., numpy) to its latest version?

A

pip install --upgrade numpy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you install packages listed in a requirements.txt file?

A

pip install -r requirements.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you uninstall a package (e.g., requests)?

A

pip uninstall requests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the command to list all packages currently installed in the active environment?

A

pip list or pip freeze (which is better for generating requirements files).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the -e flag mean when installing a package?

A

It means “editable” or “development” mode. pip install -e . installs the package locally from your current project directory, allowing changes to the source code to take immediate effect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly