- How to install and use Anaconda
- Installing Anaconda
- Starting Spyder
- Starting Jupyter Notebook
- Example notebooks
- Working with course-specific environments
- Step 1 of 3: Update your Anaconda installation
- Step 2 of 3: Import the .yaml file
- Step 3 of 3: Starting Spyder from the correct environment
- Recommendations for teachers
- Debugging Python programs
- Установка Anaconda в Ubuntu
- Установка Anacoda в Ubuntu
- 1. Скачивание и установка программы
- 2. Обновление Anaconda
- 3. Окружения Conda
- 4. Установка пакетов Conda
- Удаление Anaconda
- Выводы
- Getting started with Navigator¶
- Before you start¶
- Contents¶
- Starting Navigator¶
- Managing Navigator¶
- Managing Environments¶
- Managing Python¶
- Managing packages¶
How to install and use Anaconda
We recommend using the Anaconda distribution to install Python, Spyder as your programming environment, and Jupyter Notebook for creating interactive documents.
Installing Anaconda
Make sure to click Install for me only if the installer says: You cannot install Anaconda3 in this location. The Anaconda3 installer does not allow its software to be installed here.
Windows
Linux
Anaconda may also be run from the calcfarm.ntnu.no server, but it is highly recommended to install it on your own computer. Learn how to connect to Calcfarm if you are unable to install Anaconda.
Starting Spyder
The Spyder editor supports interactive testing, debugging, a variable explorer and other nice things.
To start Spyder, first open Anaconda Navigator:
Then, click the Launch button below the Spyder icon on the Navigator Home tab:
Starting Jupyter Notebook
A Jupyter Notebook lets you combine code, explanatory text, mathematics, plots, and more in a single document.
Notebook documents contain the inputs and outputs of your computation, and can serve as a complete computational record of a session, making it easy to share reproducible work.
To start Jupyter Notebook, first open Anaconda Navigator as described in the previous section, then click the Launch button below the Jupyter Notebook icon.
To start using Notebooks, read more about:
Example notebooks
Download the notebook file to open the full, interactive notebook on your own computer, or view a static version of the notebook online:
Download notebook | View read-only version |
---|---|
Introduksjon.ipynb | Introduksjon til bruk av Jupyter med Python |
IkkeLineareLigninger.ipynb | Numerisk løsning av ikke-lineære ligninger |
Working with course-specific environments
If your course needs other packages than those installed by default, these will be installed in a separate environment, and you’ll need to use that environment for course work. The steps involved are:
Step 1 of 3: Update your Anaconda installation
First, open an Anaconda Prompt:
Then, run the following two commands:
Step 2 of 3: Import the .yaml file
Download the .yaml file from the course home page and save it to your computer.
Open Anaconda Navigator and click the Environments tab in the left menu. Then click Import and select the .yaml file you downloaded.
For more information, refer to Managing environments in the Anaconda documentation.
Step 3 of 3: Starting Spyder from the correct environment
To use this environment, you must select it from the drop-down menu in the Home tab before starting Spyder:
Recommendations for teachers
If you are using Python in your course, we recommend that you:
Install Anaconda exactly as described above, and use this version to create exercises. There may be differences between the packages in your «normal» Python installation and those that Anaconda comes with, and you should run exactly the same environment as your students will.
If you need extra packages, do not ask your students to install them using conda or pip commands. Instead,
Debugging Python programs
A short introduction to debugging Python programs in Spyder are available in English and Norwegian:
Источник
Установка Anaconda в Ubuntu
Anaconda — это очень популярный дистрибутив Python, который содержит удобный пакетный менеджер Conda, несколько предустановленных версий Python (2.7, 3.4 и 3.7), а также среду разработки IDLE Spider и множество библиотек, которые очень просто установить. Ещё здесь есть библиотеки для обработки Big Data, прогнозной аналитики и научных вычислений. Также можно всем управлять через графическую утилиту Anaconda Navigator.
В этой статье мы рассмотрим, как скачать и установить Anaconda Python Ubuntu 18.04 с официального сайта программы, а также как подготовить эту платформу к работе.
Установка Anacoda в Ubuntu
1. Скачивание и установка программы
Сначала нужно скачать установщик платформы с официального сайта. На момент написания статьи самая свежая версия программы — 2019.03. Нажмите кнопку Download, а затем выберите операционную систему Linux:
Вы можете скачать программу прямо в браузере или скопировать ссылку для загрузки через wget. Например, для текущей версии команда будет выглядеть так:
Поскольку это достаточно большой файл, после завершения загрузки желательно проверить его по контрольной суме. Найти контрольную сумму загруженного файла можно командой:
Затем её нужно сравнить с сумой, указанной на этой странице для вашей версии программы. Если полученные значения совпадают, значит всё правильно.
Далее запустите полученный скрипт:
На первом шаге установки нажмите Enter, затем наберите yes, чтобы принять лицензионное соглашение:
Далее нужно выбрать папку, куда будет установлена программа:
Затем пойдёт установка Anaconda 3 Ubuntu. Процесс установки займёт некоторое время.
В конце установки программа предложит изменить
/.bashrc таким образом, чтобы Сonda запускалась автоматически при запуске терминала. Если вы не сделали это во время установки, то это можно выполнить потом командой:
conda init bash
Затем выполните следующую команду, чтобы система перечитала настройки:
Теперь вы можете проверить, всё ли работает, выполнив такую команду:
На этом установка Anaconda Ubuntu завершена.
2. Обновление Anaconda
Обновление Anaconda тоже достаточно просто выполнить. Сначала нужно обновить инструмент conda. Для этого выполните:
conda update conda
На вопросы программы отвечайте y. Когда обновление завершится, можно обновить саму Anaconda 3:
conda update anaconda
Аналогично предыдущему пункту, нажмите y, чтобы продолжить обновление.
3. Окружения Conda
Как я уже сказал, Сonda — это пакетный менеджер, а также это менеджер окружений. Вы можете создать несколько окружений с разными версиями Python, а также с разными установленными в них библиотеками. Посмотреть список доступных окружений можно командой:
conda info —envs
Для активации окружения используется команда activate. Например, сделаем активным окружение base:
conda activate base
Также вы можете создать новое окружение с другой версией Python. Например, сделаем окружение с Python 3.5:
conda create —name ptn35env python=3.5
Программа создаст окружение и сообщит, какие пакеты ей надо установить, соглашаемся на установку:
Затем активируем нужное окружение:
conda activate ptn35env
Чтобы деактивировать текущее окружение, используйте команду deactivate:
Чтобы удалить окружение ptn35env, нужно использовать не команду uninstall, а remove:
conda remove —name ptn35env -all
4. Установка пакетов Conda
Посмотреть список установленных пакетов можно командой list:
Чтобы найти нужный пакет, используйте search, например, ищем пакетный менеджер Python — pip:
comda search pip
А для установки пакета используйте install. Например, установим tensorflow:
conda install tensorflow
Удалить пакет можно командой remove:
conda remove tensorflow
Удаление Anaconda
Чтобы удалить Anaconda из своей системы, достаточно выполнить следующие команды:
/.bashrc и удалите оттуда строки, добавленные Anaconda, обычно, находятся между тегами conda initialize:
Затем удалите скрытые папки с дополнительными файлами и конфигурацией платформы:
Выводы
Теперь установка Anaconda в Ubuntu завершена. Вы можете начать пользоваться пакетным менеджером Conda, использовать виртуальные окружения в Python и легко устанавливать пакеты. Мы разобрали только основы использования conda, чтобы изучить программу лучше, читайте официальную документацию.
Источник
Getting started with Navigator¶
Anaconda Navigator is a graphical user interface to the conda package and environment manager.
This 10-minute guide to Navigator will have you navigating the powerful conda program in a web-like interface without having to learn command line commands.
SEE ALSO: Getting started with conda to learn how to use conda. Compare the Getting started guides for each to see which program you prefer.
Before you start¶
You should have already installed Anaconda .
Contents¶
- Starting Navigator on Windows, macOS, or Linux. 1 MINUTE
- Managing Navigator . Verify that Anaconda is installed and check that Navigator is updated to the current version. 1 MINUTE
- Managing environments . Create environments and move easily between them. 3 MINUTES
- Managing Python . Create an environment that has a different version of Python. 2 MINUTES
- Managing packages . Find packages available for you to install. Install packages. 3 MINUTES
TOTAL TIME: 10 MINUTES
Starting Navigator¶
Windows
- From the Start menu, click the Anaconda Navigator desktop app.
- Or from the Start menu, search for and open “Anaconda Prompt” and type the command anaconda-navigator .
MacOS
- Open Launchpad, then click the Anaconda-Navigator icon.
- Or open Launchpad and click the terminal icon. Then in terminal, type anaconda-navigator .
Linux
- Open a terminal window and type anaconda-navigator .
Managing Navigator¶
Verify that Anaconda is installed and running on your system.
- When Navigator starts up, it verifies that Anaconda is installed.
- If Navigator does not start up, go back to Anaconda installation and make sure you followed all the steps.
Check that Navigator is updated to the current version.
When you start Navigator, it automatically checks for a new version. If Navigator finds a new version, you will see a dialog box like this:
Click the “Yes” button to update Navigator to the current version.
We recommend that you always keep Navigator updated to the latest version.
Managing Environments¶
Navigator uses conda to create separate environments containing files, packages, and their dependencies that will not interact with other environments.
Create a new environment named snowflakes and install a package in it:
In Navigator, click the Environments tab, then click the Create button. The Create new environment dialog box appears.
In the Environment name field, type a descriptive name for your environment.
Click Create. Navigator creates the new environment and activates it.
Now you have two environments, the default environment base (root) , and snowflakes .
Switch between them (activate and deactivate environments) by clicking the name of the environment you want to use.
The active environment is the one with the arrow next to its name.
Return to the other environment by clicking its name.
Managing Python¶
When you create a new environment, Navigator installs the same Python version you used when you downloaded and installed Anaconda. If you want to use a different version of Python, for example Python 3.5, simply create a new environment and specify the version of Python that you want in that environment.
Create a new environment named “snakes” that contains Python 3.5:
In Navigator, click the Environments tab, then click the Create button.
The Create new environment dialog box appears.
In the Environment name field, type the descriptive name “snakes” and select the version of Python you want to use from the Python Packages box (3.8, 3.7, 3.6, 3.5, or 2.7). Select a different version of Python than is in your other environments, base or snowflakes.
Click the Create button.
Activate the version of Python you want to use by clicking the name of that environment.
Managing packages¶
In this section, you check which packages you have installed, check which are available, and look for a specific package and install it.
To find a package you have already installed, click the name of the environment you want to search. The installed packages are displayed in the right pane.
You can change the selection of packages displayed in the right pane at any time by clicking the drop-down box above it and selecting Installed, Not Installed, Updatable, Selected, or All.
Check to see if a package you have not installed named “beautifulsoup4” is available from the Anaconda repository (must be connected to the Internet). On the Environments tab, in the Search Packages box, type beautifulsoup4 , and from the Search Subset box select All or Not Installed.
To install the package into the current environment, check the checkbox next to the package name, then click the bottom Apply button.
The newly installed program is displayed in your list of installed programs.
Источник