What is the difference between the install
statement and the import
statement in Jupyterlab Notebooks?
JavaScript
x
5
1
!pip install xlrd
2
3
4
import pandas as pd
5
Why can’t we say !pip install pandas
or import xlrd
for example?
[Screenshot of my notebook : https://i.stack.imgur.com/IxNjA.png ]
Advertisement
Answer
The install
command is used to install a python library. In your case you have already installed xlrd
, hence the output Requirement already satisfied
.
The import
command is used to import an already existing library to your code. Basically it tells python to use this library in your program.