PyPi and Anaconda

When you’ll dive deeper in the use of Python, you will quickly notice that there are lots of libraries, i.e. open source projects you can install, which handle a lot for your and avoid having to implement everything from scratch each time.

Among them, we can mention:

  • NumPy: array manipulation and computation
  • Pandas: loading data in dataframes
  • SciPy: scientific package (signal processing…)
  • Matplotlib: plotting graphs
  • Scikit-learn: machine learning
  • NLTK: natural language processing

To install these packages, there are 2 options:

  • either clone the repository on Github. This is advised only if the second option is not available
  • install the package via PyPi or Anaconda.

PiPy and Anaconda are distributions. They allow you to install Python packages in a single command line, and store the code in the right directory of your computer.

To install a package from PyPi, simply type in your terminal :

pip install package_name

This will run the whole installation process for you. Then, if you want to see the list of all packages you have installed up to date, use:

pip list

Which heads something like:

Package                            Version     
---------------------------------- ------------
absl-py                            0.8.1       
address                            0.1.1       
alabaster                          0.7.12      
allennlp                           0.9.0       
altair                             3.2.0       
anaconda-client                    1.7.2       
anaconda-navigator                 1.9.7     

Anaconda does a similar job when it comes to package installing. However, they do have a higher control over the quality of the packages they distribute, and therefore some implementations that rely on Anaconda run faster than other implementations that use PyPi.

To install a package with Anaconda, simply type:

conda install package_name

To see all the packages in your environment using conda command, you can type:

conda list

This will head:

# Name                    Version                   Build  Channel
_anaconda_depends         2019.03                  py37_0    anaconda
_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0  
absl-py                   0.8.1                    pypi_0    pypi

If you found the article useful or see ways in which it could be improved, please leave a comment :)

Like it? Buy me a coffeeLike it? Buy me a coffee



Leave a comment