2: Conda Package Management System (2024)

  1. Last updated
  2. Save as PDF
  • Page ID
    433859
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}}}\) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Conda

    Conda is a cross platform package management system. It allows you to install, update and manage software packages and dependencies. Conda makes it easy to update Python and ohter packages. There are two ways to run Conda, through the command line, or through the Anaconda-Navigator GUI. There are three advantages to installing Condaand you should install a package management system like Conda if you intend to tackle data science projects..

    1. Package Management: Condaallows you to install, update and manage packages for multiple programming languages like Python. Some packages you may be interested in areScikit learn (Machine Learning package), Matplotlib....
    2. Environment Management: Allows you to create isolated environements with specific packages and dependencies (some package may require different versions of Python).
    3. Cross-Platform Support:

    Distributions

    There are two distributions of Conda;Anaconda and Miniconda. Anaconda comes with a large number of preinstalled packages and the Anaconda Navigator, which is a GUI that allows you to manage your packages. Minicondais a bare bones installation of Conda that only includes a fewessential packages. You should install Anaconda ifyou are interested in Data Scienceand have lots of free space on your computer. We will provide a tutorial on using Minicondaand only install packages we need.

    Minconda

    Minicondainstalls Conda, Python and a few other useful packages like pip, and zlib. To install additional packages you will need to use the conda install command. In this activity we will install minicondaand show you how to make the Python version in miniconda the default interpreter in Thonny. It will then be easy to update Python by using Conda.

    Go to the following URL and choose the Miniconda Installer Links for your operating system and download the executable file.

    https://docs.conda.io/en/latest/miniconda.html

    The following images are screen shots for installingMiniconda that date to 2022, and may have changed since them.

    Once you install Miniconda you want to open the Anaconda prompt (miniconda 3) from your Windows start menu, which can be done by typing in the search: Anaconda

    2: Conda Package Management System (2)

    If you are using a Windows machine the command prompts are different than Linuxges you want to type the following into the command prompt. You first need to navigate to the correct folder. In the command prompt (which is a terminal shell) type ls to see your folders.

    Note <ctrl> C bring back the command prompt if you get stuck

    ls#you may need to use if on windowsdir

    Now move to that directory (Change Directory)

     cd .\miniconda3\

    When you list the files you will see where you installed python

    You will also want to update python

    conda update python

    Exit the anaconda shell

    exit

    Changing Default Thonny Python Interpreter

    Now we want to link our Thonny to the new install of python. Open Thonny and go to tools/options/interpreter (figure \(\PageIndex{12}\)) and choose the "Alternative Python 3 interpreter or virtual environment". Initially the python executable will direct to where you installed Thonny and you need to direct it to the new path, which you found above. Or you can click the three dots tothe right of the current path and navigate to where the python application file is located and open it.

    If you now look at the shell in Thonny you can see the new updated Python program you are running

    Anaconda

    Anaconda is a data science platform which allows you to find and install over 7,500 data science and machine learning package and progarams likePython, R, Jupyter, Scikit learn, matplotlib andR, but also includes theconda package manager that helps deal with conflicts across software. There are two installation options, Anaconda and Miniconda. If you are planning to get involved with Data Sciences or have a high quality computer you will probably want to install the full version of Anaconda, but if this class is your only endeavor than you will probably want to install the Miniconda version. Note, the full version comes with the Anaconda Navigator thatmakes it very easy to launch and maintainpackages, where the Miniconda requires you to use to launch programs through the conda prompt. What we are going to do in this class is connect the Thonny IDE to the Python interpreter installed with either Anaconda or Miniconda and use Thonny to launch Python. We are choosing Thonny because it comes installed with the Raspberry Pi. We will also be using MS Visual Studio Code as it integrates with Git and GitHub versioning software

    • Anaconda
      • https://www.anaconda.com/
        • Well suited for scientific programmings. Comes with ipython and Spyder, and the Conda package management system.
        • Has 1500 scientific packages and uses 3GB of disk space

    Anaconda Navigator

    In your user directory type

    conda install anaconda-navigator
    2: Conda Package Management System (2024)
    Top Articles
    Latest Posts
    Article information

    Author: Mr. See Jast

    Last Updated:

    Views: 6200

    Rating: 4.4 / 5 (75 voted)

    Reviews: 82% of readers found this page helpful

    Author information

    Name: Mr. See Jast

    Birthday: 1999-07-30

    Address: 8409 Megan Mountain, New Mathew, MT 44997-8193

    Phone: +5023589614038

    Job: Chief Executive

    Hobby: Leather crafting, Flag Football, Candle making, Flying, Poi, Gunsmithing, Swimming

    Introduction: My name is Mr. See Jast, I am a open, jolly, gorgeous, courageous, inexpensive, friendly, homely person who loves writing and wants to share my knowledge and understanding with you.