User Tools

Site Tools


it:anaconda

anaconda

Introduction

  • basic level Anaconda is a free application which is used for:
    • installing Python language, modules, and tools
    • creating Python sand boxed environments
    • launching Python tools such as Jupyter notebooks
  • it is a Python/R data science distribution containing conda.
  • Conda is an environment and package manager that helps users manage the other 7,500+ open-source packages made available to them through the distribution.
  • Anaconda Navigator
    • is a GUI app for managing environments, packages and launching apps
  • Anaconda terminal command prompt method of accessing conda and pip:
    • this can:
      • activate your environment
      • install Python modules
  • It uses “channels” to specify URLs which point to package repositories
    • the default channel points to several channels at the repo.anaconda.com
  • this installation can get complicated to ensure all the versions of modules play together in the correct environment and can lead to kernel failures when running Jupyter notebooks if not installed correctly
  • if you install Python modules with pip instead of with conda, conda may not be aware of them

Anaconda command prompt

check the conda install

conda info
conda update -n base conda #optionally run this to update the conda install to latest install
conda update anaconda #optionally run this to update the anaconda install to latest install

set your environment within the terminal

conda activate environment_name

install apps into the set environment

conda install -c main pandas
conda install numPy
conda install matplotlib
conda install -c main scikit-learn
conda install scikit-learn-intelex # this is an accelerator for scikit-learn for win64
conda install -c main tensorflow #in July 2023, this will not install on python v3.11 as only compatible with python 3.5.* to 3.10.*
conda install -c main nltk #natural language toolkit
conda install -c pytorch pytorch-cuda #NB. -c is the channel parameter so here it is using the pytorch channel to search and install the latest pytorch-cuda package
#can use -n ENVNAME to choose the environment to install if you have not activated that environment
  • unfortunately on my system, I was not able to install PyTorch cuda version with this as I continually got errors solving environment and had to resort to a pip install

Anaconda Navigator

  • create a new environment
    • click on left menu item Environments then at bottom of screen click on Create then name your new environment
    • you can then use Command Prompt to install additional modules into this such as MatPlotlib. NumPy, PyTorth cuda version, etc
  • use your new environment for launching apps
    • manually select your new environment via clicking on the environment under the menu item Environments, or,
    • set that environment top be the default File:Preferences then set Default Conda Environment
  • run app to use your environment
    • go to Home menu item option
    • ensure your environment is the one selected then launch your app (if no launch button visible, you need to install the app first using the install button)
    • eg. launch Jupyter Notebook
      • this will open Jupyter Notebook in a web browser and then open the main directory url http://localhost:8888/tree so you can choose to open an existing notebook (.ipynb files), or create a new one using the Python 3 kernel
it/anaconda.txt · Last modified: 2023/07/27 06:07 by gary1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki