Page 250 - Beginning Programming with Pyth - John Paul Mueller
P. 250

 FIGURE 11-9: You must request information about environment variables separately.
You can also add and remove items from sys.path. For example, if you want to add the current working directory to the list of packages, you type sys.path.append(os.getcwd()) in the Notebook cell and click Run Cell. When you list the sys.path contents again, you see that the new entry is added to the end of the list. Likewise, when you want to remove an entry you type sys.path.remove(os.getcwd()) in the Notebook cell and click Run Cell. The addition is present only during the current session.
Downloading Packages from Other Sources
Your copy of Python and the associated Jupyter Notebook component of Anaconda come with a wide assortment of packages that fulfill many common needs. In fact, for experimentation purposes, you seldom have to go beyond these packages because you already have so many of them installed on your system. Of course, someone is always thinking of some new way to do things, which requires new code and packages to store the code. In addition, some coding techniques are so esoteric that including the packages to support them with a default install would consume space that most people will never use. Consequently, you may have to install packages from online or other sources from time to time.
The two most common methods of obtaining new packages are to use the conda or pip (also known by the recursive acronym Pip Installs Packages) utilities. However, you may find packages that use other installation methods with varying degrees of success. You use conda and pip for different purposes. Many misconceptions exist about the two package managers, but it really comes down to conda providing general- purpose package management for a wide range of languages with
  





























































































   248   249   250   251   252