Install and import in Jupyter Notebook

  • Thread starter Thread starter fog37
  • Start date Start date
  • Tags Tags
    install
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
fog37
Messages
1,566
Reaction score
108
TL;DR
install and import commands meaning
Hello again,
  • import command: when working with Jupyter notebooks and Python, the command import is used to import both modules and libraries into the working environment, i.e. the notebook itself, correct? This means that the module or library is already installed, i.e. all the code is already present in our computer (it was provided when we downloaded Jupiter or the distribution that Jupyter comes from), and we are making its capabilities accessible from within the notebook...
  • install command: In Jupyter notebook, when we use the install command, will the module/library and all its code be uploaded from the internet? Does that mean there must be an active internet connection to perform this installation task?
Thanks!
 
Physics news on Phys.org
import is a python statement to link python code to your python script.

Several languages including Python, Java and Julia use this approach to attach external code to a program.

I've used Jupyter notebooks and they didn't require an internet connection as the server ran on my local machine. However some Python modules might need to be downloaded if they are already present.

Many people choose the Anaconda distro with Jupyter notebooks so that most modules of interest are already installed and ready to use.

https://lectures.quantecon.org/py/getting_started.html
 
The import command is what's used for a specific Jupyter notebook. It loads libraries from what is already installed on your computer.

The install command does reach out to the internet to load new modules that you haven't previously installed. Once they're loaded, you can then use them in an import.

As @jedishrfu suggested, the Anaconda distro is the best starting point and contains many pre-loaded libraries and modules.
 
  • Like
Likes   Reactions: jedishrfu and fog37