Install and import in Jupyter Notebook

  • Thread starter Thread starter fog37
  • Start date Start date
  • Tags Tags
    install
Click For Summary
The discussion clarifies the use of the import and install commands in Jupyter notebooks with Python. The import command is utilized to access pre-installed modules and libraries within the local environment, meaning the necessary code is already present on the computer. In contrast, the install command is used to download new modules from the internet, requiring an active internet connection for this process. It is noted that many users prefer the Anaconda distribution, which comes with a wide array of pre-installed libraries, making it easier to start working in Jupyter notebooks without additional setup.
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!
 
Technology 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 jedishrfu and fog37
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
7
Views
1K
Replies
3
Views
3K
  • · Replies 12 ·
Replies
12
Views
9K
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
2K