forked from AITech/aitech-ium
1498 lines
71 KiB
Plaintext
1498 lines
71 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "be5ab2df",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Środowiska wirtualne"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "cf14c577",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Python Virtual Env\n",
|
||
|
" - Python posiada wbudowany mechanizm do zarządzania wirtualnymi środowiskami\n",
|
||
|
" - Nie mylić z bardziej rozbudowanym [virtualenv](https://pypi.org/project/virtualenv/) (dla Python 2)\n",
|
||
|
" - Umożliwia używanie różnych wersji bibliotek do różnych zastosowań\n",
|
||
|
" - Dotyczy on tylko bibliotek pythona\n",
|
||
|
" - Więcej informacji: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "182bbf83",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Poniżej stworzymy środowisko w katalogu `./myenv`:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "69d39a9e",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"```\n",
|
||
|
"$ python3 -m venv myenv\n",
|
||
|
"```"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "47a4bf00",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Teraz możemy je aktywować:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "cf54cb09",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"```\n",
|
||
|
"$ source ./myenv/bin/activate\n",
|
||
|
"(myenv) $ which python\n",
|
||
|
"/home/tomek/myenv/bin/python\n",
|
||
|
"```"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "bdafb824",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"I modyfikować instalując zależności:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "399a8b45",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"```\n",
|
||
|
"(myenv) $ python3 -m pip install requests\n",
|
||
|
"```"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "efde93a2",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Środowisko możemy deaktywować poprzez:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "838c5ebd",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"```\n",
|
||
|
"deactivate\n",
|
||
|
"```"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "0557e0c8",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Środowisko można udostępnić kopiując cały katalog ze środowiskiem"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "26f253cb",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Conda\n",
|
||
|
"> *Package, dependency and environment management for any language—Python, R, Ruby, Lua, Scala, Java, JavaScript, C/ C++, FORTRAN, and more.*\n",
|
||
|
"\n",
|
||
|
"<img src=\"img/environments/conda.png\"/>\n",
|
||
|
"\n",
|
||
|
"Conda umożliwia zarządzanie:\n",
|
||
|
" - środowiskami (jak venv)\n",
|
||
|
" - paczkami i zależnościami (jak pip)\n",
|
||
|
"\n",
|
||
|
"Dokumentacja: https://docs.conda.io/en/latest/\n",
|
||
|
"\n",
|
||
|
"Różnice między Conda a venv [źródło](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/environments.html#virtual-environments):\n",
|
||
|
" - Dowolna wersja Python w Conda (inna niż systemowa)\n",
|
||
|
" - Conda zarządza też zależnościami innymi niż Pythonowe\n",
|
||
|
" - Paczki w PyPI (używane przez P"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "57f19a08",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Dystrybucje: Anaconda i Conda\n",
|
||
|
"Conda jest dostępna w dwóch dystrybcjach:\n",
|
||
|
" - [Miniconda](https://docs.conda.io/en/latest/miniconda.html):\n",
|
||
|
" - wymaga 400 MB miejsca na dysku\n",
|
||
|
" - zawiera jedynie podstawowe narzędzia:\n",
|
||
|
" - conda\n",
|
||
|
" - Python\n",
|
||
|
" - pip, zlib\n",
|
||
|
" - pozostałe narzędzia/biblioteki doinstalujemy w miarę potrzeb\n",
|
||
|
" - [Anaconda](https://www.anaconda.com/products/individual)\n",
|
||
|
" - wymaga conajmniej 3 GB miejsca na dysku\n",
|
||
|
" - Zawiera narzędzi GUI [Anaconda Navigator](https://docs.anaconda.com/anaconda/navigator/) (można je doinstalować do Miniconda)\n",
|
||
|
" - zawiera to co Miniconda +:\n",
|
||
|
" - Ponad 1500 preinstalowanych pakietów, głównie \"naukowych\", m.in.: SciPy, NumPy, Jupyter, scikit-learn, Pandas\n",
|
||
|
" "
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "b199274c",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Dystrybucje\n",
|
||
|
" - Wersje paczek/bibliotek zawartych w danej dystrybucji są przetestowane pod względem zgodności ze sobą\n",
|
||
|
" - Możemy dokonać zaktualizacji wszystkich pakietów za pomocą polecenia: `conda update conda`\n",
|
||
|
" - Conda zatroszczy się o to, by rozwiązać potencjalne konflikty wynikające z zależności deklarowanych przez poszczególne biblioteki. \n",
|
||
|
" - Nie zawsze wszystkie biblioteki będą w swoich najnowszych wersjach - mogłoby to powodować problemy z działaniem bibliotek od nich zależnych\n",
|
||
|
" - Podczas aktualizacji niektóre biblioteki mogą zostać \"zdowngradowane\""
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "b1d8c391",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"```\n",
|
||
|
"$ conda update conda\n",
|
||
|
"Collecting package metadata (current_repodata.json): done\n",
|
||
|
"Solving environment: done\n",
|
||
|
"\n",
|
||
|
"## Package Plan ##\n",
|
||
|
"\n",
|
||
|
" environment location: /home/tomek/miniconda3\n",
|
||
|
"\n",
|
||
|
" added / updated specs:\n",
|
||
|
" - conda\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"The following packages will be downloaded:\n",
|
||
|
"\n",
|
||
|
" package | build\n",
|
||
|
" ---------------------------|-----------------\n",
|
||
|
" attrs-21.2.0 | pyhd3eb1b0_0 46 KB\n",
|
||
|
" cffi-1.14.5 | py39h261ae71_0 226 KB\n",
|
||
|
" chardet-4.0.0 |py39h06a4308_1003 194 KB\n",
|
||
|
" conda-package-handling-1.7.3| py39h27cfd23_1 884 KB\n",
|
||
|
" cryptography-3.4.7 | py39hd23ed53_0 906 KB\n",
|
||
|
" decorator-5.0.9 | pyhd3eb1b0_0 12 KB\n",
|
||
|
" glib-2.68.2 | h36276a3_0 3.0 MB\n",
|
||
|
" idna-2.10 | pyhd3eb1b0_0 52 KB\n",
|
||
|
" jinja2-3.0.0 | pyhd3eb1b0_0 106 KB\n",
|
||
|
" markupsafe-2.0.1 | py39h27cfd23_0 22 KB\n",
|
||
|
" notebook-6.4.0 | py39h06a4308_0 4.1 MB\n",
|
||
|
" pygments-2.9.0 | pyhd3eb1b0_0 721 KB\n",
|
||
|
" pyopenssl-20.0.1 | pyhd3eb1b0_1 49 KB\n",
|
||
|
" requests-2.25.1 | pyhd3eb1b0_0 52 KB\n",
|
||
|
" ruamel_yaml-0.15.100 | py39h27cfd23_0 260 KB\n",
|
||
|
" tqdm-4.59.0 | pyhd3eb1b0_1 93 KB\n",
|
||
|
" urllib3-1.26.4 | pyhd3eb1b0_0 105 KB\n",
|
||
|
" ------------------------------------------------------------\n",
|
||
|
" Total: 10.7 MB\n",
|
||
|
"\n",
|
||
|
"The following packages will be REMOVED:\n",
|
||
|
"\n",
|
||
|
" libedit-3.1.20191231-h14c3975_1\n",
|
||
|
" pip-20.3.1-py39h06a4308_0\n",
|
||
|
" wheel-0.36.1-pyhd3eb1b0_0\n",
|
||
|
"\n",
|
||
|
"The following packages will be UPDATED:\n",
|
||
|
"\n",
|
||
|
" attrs 20.3.0-pyhd3eb1b0_0 --> 21.2.0-pyhd3eb1b0_0\n",
|
||
|
" ca-certificates conda-forge::ca-certificates-2020.12.~ --> pkgs/main::ca-certificates-2021.4.13-h06a4308_1\n",
|
||
|
" cffi 1.14.4-py39h261ae71_0 --> 1.14.5-py39h261ae71_0\n",
|
||
|
" chardet 3.0.4-py39h06a4308_1003 --> 4.0.0-py39h06a4308_1003\n",
|
||
|
" conda conda-forge::conda-4.10.1-py39hf3d152~ --> pkgs/main::conda-4.10.1-py39h06a4308_1\n",
|
||
|
" conda-package-han~ 1.7.2-py39h27cfd23_1 --> 1.7.3-py39h27cfd23_1\n",
|
||
|
" cryptography 3.3.1-py39h3c74f83_0 --> 3.4.7-py39hd23ed53_0\n",
|
||
|
" decorator 5.0.6-pyhd3eb1b0_0 --> 5.0.9-pyhd3eb1b0_0\n",
|
||
|
" glib 2.68.1-h36276a3_0 --> 2.68.2-h36276a3_0\n",
|
||
|
" jinja2 2.11.3-pyhd3eb1b0_0 --> 3.0.0-pyhd3eb1b0_0\n",
|
||
|
" markupsafe 1.1.1-py39h27cfd23_0 --> 2.0.1-py39h27cfd23_0\n",
|
||
|
" notebook 6.3.0-py39h06a4308_0 --> 6.4.0-py39h06a4308_0\n",
|
||
|
" pygments 2.8.1-pyhd3eb1b0_0 --> 2.9.0-pyhd3eb1b0_0\n",
|
||
|
" pyopenssl 20.0.0-pyhd3eb1b0_1 --> 20.0.1-pyhd3eb1b0_1\n",
|
||
|
" readline 8.0-h7b6447c_0 --> 8.1-h27cfd23_0\n",
|
||
|
" requests 2.25.0-pyhd3eb1b0_0 --> 2.25.1-pyhd3eb1b0_0\n",
|
||
|
" ruamel_yaml 0.15.80-py39h27cfd23_0 --> 0.15.100-py39h27cfd23_0\n",
|
||
|
" setuptools 51.0.0-py39h06a4308_2 --> 52.0.0-py39h06a4308_0\n",
|
||
|
" sqlite 3.33.0-h62c20be_0 --> 3.35.4-hdfb4753_0\n",
|
||
|
" tqdm 4.54.1-pyhd3eb1b0_0 --> 4.59.0-pyhd3eb1b0_1\n",
|
||
|
" tzdata 2020d-h14c3975_0 --> 2020f-h52ac0ba_0\n",
|
||
|
" urllib3 1.25.11-py_0 --> 1.26.4-pyhd3eb1b0_0\n",
|
||
|
"\n",
|
||
|
"The following packages will be SUPERSEDED by a higher-priority channel:\n",
|
||
|
"\n",
|
||
|
" certifi conda-forge::certifi-2020.12.5-py39hf~ --> pkgs/main::certifi-2020.12.5-py39h06a4308_0\n",
|
||
|
"\n",
|
||
|
"The following packages will be DOWNGRADED:\n",
|
||
|
"\n",
|
||
|
" idna 2.10-py_0 --> 2.10-pyhd3eb1b0_0\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"Proceed ([y]/n)? y\n",
|
||
|
"\n",
|
||
|
"[...]\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"```"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "1c7b2930",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Instalacja\n",
|
||
|
"Instrukcje: \n",
|
||
|
"- [Linux](https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html)\n",
|
||
|
"- [Windows](https://docs.conda.io/projects/conda/en/latest/user-guide/install/windows.html)\n",
|
||
|
"- [macOS](https://docs.conda.io/projects/conda/en/latest/user-guide/install/macos.html)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "3edc108c",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Pakiety Conda\n",
|
||
|
"Pakiet (Package) conda to archiwum o rozszerzeniu `.tar.bz2` lub `.conda`zawierające:\n",
|
||
|
" - folder `lib`: biblioteki systemowe, moduły Python\n",
|
||
|
" - folder `bin`: pliki wykonywalne i wszelkie inne pliki potrzebne to zainstalowania danej zależności\n",
|
||
|
" - metadane w katalogu `info/`\n",
|
||
|
" \n",
|
||
|
" \n",
|
||
|
" \n",
|
||
|
"Pakiety można:\n",
|
||
|
" - wyszukiwać: `conda search pytorch`\n",
|
||
|
" - instalować: `conda install pytorch`\n",
|
||
|
" - tworzyć: `conda build hello_world`\n",
|
||
|
" - usuwać: `conda remove pytorch`\n",
|
||
|
" "
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "3094ba52",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"### Repozytoria i kanały\n",
|
||
|
"- Pakiety mogą być ściągane z różnych kanałów (\"channels\")\n",
|
||
|
"- Kanały mogą być zdalne albo lokalne\n",
|
||
|
"- Domyślny kanał to https://repo.anaconda.com/pkgs/ - zawiera ponad 7,5 tys pakietów, jest utrzymywany przez Anacondę.\n",
|
||
|
"- Jeśli jakiejś paczki nie ma na oficjalnym kanale, bardzo możliwe, że znajdziemy ją na [Conda-forge](https://conda-forge.org/) - kanale utrzymywanym przez społeczność\n",
|
||
|
"- Wyszukiwanie i przeglądanie pakietów: [conda i conda-forge](https://anaconda.org/anaconda/repo)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "8c045d64",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Na przykład, pakiet `mlflow` nie jest dostępny na oficjalnym kanale:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 6,
|
||
|
"id": "9d72552f",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Loading channels: done\n",
|
||
|
"No match found for: mlflow. Search: *mlflow*\n",
|
||
|
"\n",
|
||
|
"PackagesNotFoundError: The following packages are not available from current channels:\n",
|
||
|
"\n",
|
||
|
" - mlflow\n",
|
||
|
"\n",
|
||
|
"Current channels:\n",
|
||
|
"\n",
|
||
|
" - https://repo.anaconda.com/pkgs/main/linux-64\n",
|
||
|
" - https://repo.anaconda.com/pkgs/main/noarch\n",
|
||
|
" - https://repo.anaconda.com/pkgs/r/linux-64\n",
|
||
|
" - https://repo.anaconda.com/pkgs/r/noarch\n",
|
||
|
"\n",
|
||
|
"To search for alternate channels that may provide the conda package you're\n",
|
||
|
"looking for, navigate to\n",
|
||
|
"\n",
|
||
|
" https://anaconda.org\n",
|
||
|
"\n",
|
||
|
"and use the search bar at the top of the page.\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda search mlflow"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "123b3e4e",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Do poleceń `search` i `install` możemy dodać flagę `channel` co doda podany kanał do listy przeszukiwanych przez to polecenie kanałów:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 7,
|
||
|
"id": "d55a2d84",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Loading channels: done\n",
|
||
|
"# Name Version Build Channel \n",
|
||
|
"mlflow 0.9.0.1 py_0 conda-forge \n",
|
||
|
"mlflow 0.9.1 py_0 conda-forge \n",
|
||
|
"mlflow 1.0.0 py27_0 conda-forge \n",
|
||
|
"mlflow 1.0.0 py27_1 conda-forge \n",
|
||
|
"mlflow 1.0.0 py_2 conda-forge \n",
|
||
|
"mlflow 1.0.0 py_3 conda-forge \n",
|
||
|
"mlflow 1.1.0 py_0 conda-forge \n",
|
||
|
"mlflow 1.2.0 py_0 conda-forge \n",
|
||
|
"mlflow 1.2.0 py_1 conda-forge \n",
|
||
|
"mlflow 1.3.0 py36_0 conda-forge \n",
|
||
|
"mlflow 1.3.0 py37_0 conda-forge \n",
|
||
|
"mlflow 1.4.0 py36_0 conda-forge \n",
|
||
|
"mlflow 1.4.0 py37_0 conda-forge \n",
|
||
|
"mlflow 1.4.0 py38_0 conda-forge \n",
|
||
|
"mlflow 1.5.0 py36_0 conda-forge \n",
|
||
|
"mlflow 1.5.0 py36_1 conda-forge \n",
|
||
|
"mlflow 1.5.0 py37_0 conda-forge \n",
|
||
|
"mlflow 1.5.0 py37_1 conda-forge \n",
|
||
|
"mlflow 1.5.0 py38_0 conda-forge \n",
|
||
|
"mlflow 1.5.0 py38_1 conda-forge \n",
|
||
|
"mlflow 1.6.0 py36_0 conda-forge \n",
|
||
|
"mlflow 1.6.0 py37_0 conda-forge \n",
|
||
|
"mlflow 1.6.0 py38_0 conda-forge \n",
|
||
|
"mlflow 1.7.0 py36_0 conda-forge \n",
|
||
|
"mlflow 1.7.0 py37_0 conda-forge \n",
|
||
|
"mlflow 1.7.0 py38_0 conda-forge \n",
|
||
|
"mlflow 1.7.1 py36h9f0ad1d_0 conda-forge \n",
|
||
|
"mlflow 1.7.1 py37hc8dfbb8_0 conda-forge \n",
|
||
|
"mlflow 1.7.1 py38h32f6830_0 conda-forge \n",
|
||
|
"mlflow 1.7.2 py36h9f0ad1d_0 conda-forge \n",
|
||
|
"mlflow 1.7.2 py37hc8dfbb8_0 conda-forge \n",
|
||
|
"mlflow 1.7.2 py38h32f6830_0 conda-forge \n",
|
||
|
"mlflow 1.8.0 py36h9f0ad1d_0 conda-forge \n",
|
||
|
"mlflow 1.8.0 py37hc8dfbb8_0 conda-forge \n",
|
||
|
"mlflow 1.8.0 py38h32f6830_0 conda-forge \n",
|
||
|
"mlflow 1.9.1 py36h9f0ad1d_0 conda-forge \n",
|
||
|
"mlflow 1.9.1 py37hc8dfbb8_0 conda-forge \n",
|
||
|
"mlflow 1.9.1 py38h32f6830_0 conda-forge \n",
|
||
|
"mlflow 1.10.0 py36h9f0ad1d_0 conda-forge \n",
|
||
|
"mlflow 1.10.0 py37hc8dfbb8_0 conda-forge \n",
|
||
|
"mlflow 1.10.0 py38h32f6830_0 conda-forge \n",
|
||
|
"mlflow 1.11.0 py36h9f0ad1d_0 conda-forge \n",
|
||
|
"mlflow 1.11.0 py36h9f0ad1d_1 conda-forge \n",
|
||
|
"mlflow 1.11.0 py37hc8dfbb8_0 conda-forge \n",
|
||
|
"mlflow 1.11.0 py37hc8dfbb8_1 conda-forge \n",
|
||
|
"mlflow 1.11.0 py38h32f6830_0 conda-forge \n",
|
||
|
"mlflow 1.11.0 py38h32f6830_1 conda-forge \n",
|
||
|
"mlflow 1.12.0 py36h5fab9bb_0 conda-forge \n",
|
||
|
"mlflow 1.12.0 py37h89c1867_0 conda-forge \n",
|
||
|
"mlflow 1.12.0 py38h578d9bd_0 conda-forge \n",
|
||
|
"mlflow 1.12.1 py36h5fab9bb_0 conda-forge \n",
|
||
|
"mlflow 1.12.1 py37h89c1867_0 conda-forge \n",
|
||
|
"mlflow 1.12.1 py38h578d9bd_0 conda-forge \n",
|
||
|
"mlflow 1.13 py36h5fab9bb_0 conda-forge \n",
|
||
|
"mlflow 1.13 py37h89c1867_0 conda-forge \n",
|
||
|
"mlflow 1.13 py38h578d9bd_0 conda-forge \n",
|
||
|
"mlflow 1.13.1 py36h5fab9bb_0 conda-forge \n",
|
||
|
"mlflow 1.13.1 py36h5fab9bb_2 conda-forge \n",
|
||
|
"mlflow 1.13.1 py36hd000896_2 conda-forge \n",
|
||
|
"mlflow 1.13.1 py37h89c1867_0 conda-forge \n",
|
||
|
"mlflow 1.13.1 py37h89c1867_2 conda-forge \n",
|
||
|
"mlflow 1.13.1 py38h578d9bd_0 conda-forge \n",
|
||
|
"mlflow 1.13.1 py38h578d9bd_2 conda-forge \n",
|
||
|
"mlflow 1.13.1 py39hf3d152e_2 conda-forge \n",
|
||
|
"mlflow 1.14.0 py36h24e63a9_1 conda-forge \n",
|
||
|
"mlflow 1.14.0 py36h5fab9bb_0 conda-forge \n",
|
||
|
"mlflow 1.14.0 py36h87b8279_1 conda-forge \n",
|
||
|
"mlflow 1.14.0 py36hd000896_0 conda-forge \n",
|
||
|
"mlflow 1.14.0 py37h02d9ccd_1 conda-forge \n",
|
||
|
"mlflow 1.14.0 py37h89c1867_0 conda-forge \n",
|
||
|
"mlflow 1.14.0 py38h578d9bd_0 conda-forge \n",
|
||
|
"mlflow 1.14.0 py38he918c71_1 conda-forge \n",
|
||
|
"mlflow 1.14.0 py39ha39b057_1 conda-forge \n",
|
||
|
"mlflow 1.14.0 py39hf3d152e_0 conda-forge \n",
|
||
|
"mlflow 1.14.1 py36h24e63a9_0 conda-forge \n",
|
||
|
"mlflow 1.14.1 py36h87b8279_0 conda-forge \n",
|
||
|
"mlflow 1.14.1 py37h02d9ccd_0 conda-forge \n",
|
||
|
"mlflow 1.14.1 py38he918c71_0 conda-forge \n",
|
||
|
"mlflow 1.14.1 py39ha39b057_0 conda-forge \n",
|
||
|
"mlflow 1.15.0 py36h24e63a9_0 conda-forge \n",
|
||
|
"mlflow 1.15.0 py36h87b8279_0 conda-forge \n",
|
||
|
"mlflow 1.15.0 py37h02d9ccd_0 conda-forge \n",
|
||
|
"mlflow 1.15.0 py38he918c71_0 conda-forge \n",
|
||
|
"mlflow 1.15.0 py39ha39b057_0 conda-forge \n",
|
||
|
"mlflow 1.16.0 py36h24e63a9_0 conda-forge \n",
|
||
|
"mlflow 1.16.0 py36h87b8279_0 conda-forge \n",
|
||
|
"mlflow 1.16.0 py37h02d9ccd_0 conda-forge \n",
|
||
|
"mlflow 1.16.0 py38he918c71_0 conda-forge \n",
|
||
|
"mlflow 1.16.0 py39ha39b057_0 conda-forge \n",
|
||
|
"mlflow 1.17.0 py36h24e63a9_0 conda-forge \n",
|
||
|
"mlflow 1.17.0 py36h24e63a9_1 conda-forge \n",
|
||
|
"mlflow 1.17.0 py36h87b8279_0 conda-forge \n",
|
||
|
"mlflow 1.17.0 py36h87b8279_1 conda-forge \n",
|
||
|
"mlflow 1.17.0 py37h02d9ccd_0 conda-forge \n",
|
||
|
"mlflow 1.17.0 py37h02d9ccd_1 conda-forge \n",
|
||
|
"mlflow 1.17.0 py38he918c71_0 conda-forge \n",
|
||
|
"mlflow 1.17.0 py38he918c71_1 conda-forge \n",
|
||
|
"mlflow 1.17.0 py39ha39b057_0 conda-forge \n",
|
||
|
"mlflow 1.17.0 py39ha39b057_1 conda-forge \n",
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda search mlflow --channel conda-forge"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "a4994ed6",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Możemy dodać kanał `conda-forge` tak, żeby był używany automatycznie (bez podawania flagi `channel`):"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 11,
|
||
|
"id": "0f93ee82",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Warning: 'conda-forge' already in 'channels' list, moving to the top\n",
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda config --add channels conda-forge"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "85d7014f",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Polecanie `conda info` pokaże nam m.in. używane domyślnie kanały.\n",
|
||
|
"Możem dodawać i usuwać kanały oraz zmieniać ich kolejność (priorytet) edytując plik [`~/.condarc`](https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 10,
|
||
|
"id": "e57a28b9",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"\n",
|
||
|
" active environment : base\n",
|
||
|
" active env location : /home/tomek/miniconda3\n",
|
||
|
" shell level : 1\n",
|
||
|
" user config file : /home/tomek/.condarc\n",
|
||
|
" populated config files : /home/tomek/.condarc\n",
|
||
|
" conda version : 4.10.1\n",
|
||
|
" conda-build version : not installed\n",
|
||
|
" python version : 3.9.1.final.0\n",
|
||
|
" virtual packages : __cuda=11.2=0\n",
|
||
|
" __linux=5.4.0=0\n",
|
||
|
" __glibc=2.31=0\n",
|
||
|
" __unix=0=0\n",
|
||
|
" __archspec=1=x86_64\n",
|
||
|
" base environment : /home/tomek/miniconda3 (writable)\n",
|
||
|
" conda av data dir : /home/tomek/miniconda3/etc/conda\n",
|
||
|
" conda av metadata url : https://repo.anaconda.com/pkgs/main\n",
|
||
|
" channel URLs : https://conda.anaconda.org/conda-forge/linux-64\n",
|
||
|
" https://conda.anaconda.org/conda-forge/noarch\n",
|
||
|
" https://repo.anaconda.com/pkgs/main/linux-64\n",
|
||
|
" https://repo.anaconda.com/pkgs/main/noarch\n",
|
||
|
" https://repo.anaconda.com/pkgs/r/linux-64\n",
|
||
|
" https://repo.anaconda.com/pkgs/r/noarch\n",
|
||
|
" package cache : /home/tomek/miniconda3/pkgs\n",
|
||
|
" /home/tomek/.conda/pkgs\n",
|
||
|
" envs directories : /home/tomek/miniconda3/envs\n",
|
||
|
" /home/tomek/.conda/envs\n",
|
||
|
" platform : linux-64\n",
|
||
|
" user-agent : conda/4.10.1 requests/2.25.1 CPython/3.9.1 Linux/5.4.0-73-generic ubuntu/20.04.2 glibc/2.31\n",
|
||
|
" UID:GID : 1000:1000\n",
|
||
|
" netrc file : None\n",
|
||
|
" offline mode : False\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda info"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "9e67e25c",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Jak widać, po dodaniu kanału `conda-forge`, pakiet `mlflow` zostaje znaleziony:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 9,
|
||
|
"id": "56e51ade",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Loading channels: done\n",
|
||
|
"# Name Version Build Channel \n",
|
||
|
"mlflow 0.9.0.1 py_0 conda-forge \n",
|
||
|
"mlflow 0.9.1 py_0 conda-forge \n",
|
||
|
"mlflow 1.0.0 py27_0 conda-forge \n",
|
||
|
"mlflow 1.0.0 py27_1 conda-forge \n",
|
||
|
"mlflow 1.0.0 py_2 conda-forge \n",
|
||
|
"mlflow 1.0.0 py_3 conda-forge \n",
|
||
|
"mlflow 1.1.0 py_0 conda-forge \n",
|
||
|
"mlflow 1.2.0 py_0 conda-forge \n",
|
||
|
"mlflow 1.2.0 py_1 conda-forge \n",
|
||
|
"mlflow 1.3.0 py36_0 conda-forge \n",
|
||
|
"mlflow 1.3.0 py37_0 conda-forge \n",
|
||
|
"mlflow 1.4.0 py36_0 conda-forge \n",
|
||
|
"mlflow 1.4.0 py37_0 conda-forge \n",
|
||
|
"mlflow 1.4.0 py38_0 conda-forge \n",
|
||
|
"mlflow 1.5.0 py36_0 conda-forge \n",
|
||
|
"mlflow 1.5.0 py36_1 conda-forge \n",
|
||
|
"mlflow 1.5.0 py37_0 conda-forge \n",
|
||
|
"mlflow 1.5.0 py37_1 conda-forge \n",
|
||
|
"mlflow 1.5.0 py38_0 conda-forge \n",
|
||
|
"mlflow 1.5.0 py38_1 conda-forge \n",
|
||
|
"mlflow 1.6.0 py36_0 conda-forge \n",
|
||
|
"mlflow 1.6.0 py37_0 conda-forge \n",
|
||
|
"mlflow 1.6.0 py38_0 conda-forge \n",
|
||
|
"mlflow 1.7.0 py36_0 conda-forge \n",
|
||
|
"mlflow 1.7.0 py37_0 conda-forge \n",
|
||
|
"mlflow 1.7.0 py38_0 conda-forge \n",
|
||
|
"mlflow 1.7.1 py36h9f0ad1d_0 conda-forge \n",
|
||
|
"mlflow 1.7.1 py37hc8dfbb8_0 conda-forge \n",
|
||
|
"mlflow 1.7.1 py38h32f6830_0 conda-forge \n",
|
||
|
"mlflow 1.7.2 py36h9f0ad1d_0 conda-forge \n",
|
||
|
"mlflow 1.7.2 py37hc8dfbb8_0 conda-forge \n",
|
||
|
"mlflow 1.7.2 py38h32f6830_0 conda-forge \n",
|
||
|
"mlflow 1.8.0 py36h9f0ad1d_0 conda-forge \n",
|
||
|
"mlflow 1.8.0 py37hc8dfbb8_0 conda-forge \n",
|
||
|
"mlflow 1.8.0 py38h32f6830_0 conda-forge \n",
|
||
|
"mlflow 1.9.1 py36h9f0ad1d_0 conda-forge \n",
|
||
|
"mlflow 1.9.1 py37hc8dfbb8_0 conda-forge \n",
|
||
|
"mlflow 1.9.1 py38h32f6830_0 conda-forge \n",
|
||
|
"mlflow 1.10.0 py36h9f0ad1d_0 conda-forge \n",
|
||
|
"mlflow 1.10.0 py37hc8dfbb8_0 conda-forge \n",
|
||
|
"mlflow 1.10.0 py38h32f6830_0 conda-forge \n",
|
||
|
"mlflow 1.11.0 py36h9f0ad1d_0 conda-forge \n",
|
||
|
"mlflow 1.11.0 py36h9f0ad1d_1 conda-forge \n",
|
||
|
"mlflow 1.11.0 py37hc8dfbb8_0 conda-forge \n",
|
||
|
"mlflow 1.11.0 py37hc8dfbb8_1 conda-forge \n",
|
||
|
"mlflow 1.11.0 py38h32f6830_0 conda-forge \n",
|
||
|
"mlflow 1.11.0 py38h32f6830_1 conda-forge \n",
|
||
|
"mlflow 1.12.0 py36h5fab9bb_0 conda-forge \n",
|
||
|
"mlflow 1.12.0 py37h89c1867_0 conda-forge \n",
|
||
|
"mlflow 1.12.0 py38h578d9bd_0 conda-forge \n",
|
||
|
"mlflow 1.12.1 py36h5fab9bb_0 conda-forge \n",
|
||
|
"mlflow 1.12.1 py37h89c1867_0 conda-forge \n",
|
||
|
"mlflow 1.12.1 py38h578d9bd_0 conda-forge \n",
|
||
|
"mlflow 1.13 py36h5fab9bb_0 conda-forge \n",
|
||
|
"mlflow 1.13 py37h89c1867_0 conda-forge \n",
|
||
|
"mlflow 1.13 py38h578d9bd_0 conda-forge \n",
|
||
|
"mlflow 1.13.1 py36h5fab9bb_0 conda-forge \n",
|
||
|
"mlflow 1.13.1 py36h5fab9bb_2 conda-forge \n",
|
||
|
"mlflow 1.13.1 py36hd000896_2 conda-forge \n",
|
||
|
"mlflow 1.13.1 py37h89c1867_0 conda-forge \n",
|
||
|
"mlflow 1.13.1 py37h89c1867_2 conda-forge \n",
|
||
|
"mlflow 1.13.1 py38h578d9bd_0 conda-forge \n",
|
||
|
"mlflow 1.13.1 py38h578d9bd_2 conda-forge \n",
|
||
|
"mlflow 1.13.1 py39hf3d152e_2 conda-forge \n",
|
||
|
"mlflow 1.14.0 py36h24e63a9_1 conda-forge \n",
|
||
|
"mlflow 1.14.0 py36h5fab9bb_0 conda-forge \n",
|
||
|
"mlflow 1.14.0 py36h87b8279_1 conda-forge \n",
|
||
|
"mlflow 1.14.0 py36hd000896_0 conda-forge \n",
|
||
|
"mlflow 1.14.0 py37h02d9ccd_1 conda-forge \n",
|
||
|
"mlflow 1.14.0 py37h89c1867_0 conda-forge \n",
|
||
|
"mlflow 1.14.0 py38h578d9bd_0 conda-forge \n",
|
||
|
"mlflow 1.14.0 py38he918c71_1 conda-forge \n",
|
||
|
"mlflow 1.14.0 py39ha39b057_1 conda-forge \n",
|
||
|
"mlflow 1.14.0 py39hf3d152e_0 conda-forge \n",
|
||
|
"mlflow 1.14.1 py36h24e63a9_0 conda-forge \n",
|
||
|
"mlflow 1.14.1 py36h87b8279_0 conda-forge \n",
|
||
|
"mlflow 1.14.1 py37h02d9ccd_0 conda-forge \n",
|
||
|
"mlflow 1.14.1 py38he918c71_0 conda-forge \n",
|
||
|
"mlflow 1.14.1 py39ha39b057_0 conda-forge \n",
|
||
|
"mlflow 1.15.0 py36h24e63a9_0 conda-forge \n",
|
||
|
"mlflow 1.15.0 py36h87b8279_0 conda-forge \n",
|
||
|
"mlflow 1.15.0 py37h02d9ccd_0 conda-forge \n",
|
||
|
"mlflow 1.15.0 py38he918c71_0 conda-forge \n",
|
||
|
"mlflow 1.15.0 py39ha39b057_0 conda-forge \n",
|
||
|
"mlflow 1.16.0 py36h24e63a9_0 conda-forge \n",
|
||
|
"mlflow 1.16.0 py36h87b8279_0 conda-forge \n",
|
||
|
"mlflow 1.16.0 py37h02d9ccd_0 conda-forge \n",
|
||
|
"mlflow 1.16.0 py38he918c71_0 conda-forge \n",
|
||
|
"mlflow 1.16.0 py39ha39b057_0 conda-forge \n",
|
||
|
"mlflow 1.17.0 py36h24e63a9_0 conda-forge \n",
|
||
|
"mlflow 1.17.0 py36h24e63a9_1 conda-forge \n",
|
||
|
"mlflow 1.17.0 py36h87b8279_0 conda-forge \n",
|
||
|
"mlflow 1.17.0 py36h87b8279_1 conda-forge \n",
|
||
|
"mlflow 1.17.0 py37h02d9ccd_0 conda-forge \n",
|
||
|
"mlflow 1.17.0 py37h02d9ccd_1 conda-forge \n",
|
||
|
"mlflow 1.17.0 py38he918c71_0 conda-forge \n",
|
||
|
"mlflow 1.17.0 py38he918c71_1 conda-forge \n",
|
||
|
"mlflow 1.17.0 py39ha39b057_0 conda-forge \n",
|
||
|
"mlflow 1.17.0 py39ha39b057_1 conda-forge \n",
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda search mlflow"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "327015c2",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"\n",
|
||
|
"## Środowiska (Environments)\n",
|
||
|
"- Podstawową funkcjonalnością, którą zapewnia conda są izolowane środowiska\n",
|
||
|
"- Nie zapewniają one takiego stopnia izolacji co np. Docker, ale ma to swoje zalety\n",
|
||
|
"- Środowisko to tak naprawdę katalog zawierający zbiór bibliotek, plików wykonywalnych i innych zależności\n",
|
||
|
"- Środowiska mogą zawierać różne wersje zarówno modułów Python jak i bibliotek systemowych, plików wykonywalnych (w tym samego Pythona)\n",
|
||
|
"- Domyślne środowisko nazywa się `base`. Nie powinniśmy go modyfikować a raczej tworzyć nowe środowisko dla każdego zastosowania"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "0ef28a62",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Wyświetlanie listy środowisk:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 12,
|
||
|
"id": "2865a5cf",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"# conda environments:\n",
|
||
|
"#\n",
|
||
|
" /home/tomek/anaconda3\n",
|
||
|
"base * /home/tomek/miniconda3\n",
|
||
|
"mlflow-004410b12f95e2e00831a0ba11ee1bfdc29d6f9d /home/tomek/miniconda3/envs/mlflow-004410b12f95e2e00831a0ba11ee1bfdc29d6f9d\n",
|
||
|
"mlflow-503f0c7520a32f054a9d168bd099584a9439de9d /home/tomek/miniconda3/envs/mlflow-503f0c7520a32f054a9d168bd099584a9439de9d\n",
|
||
|
"mlflow-5987e03d4dbaa5faa1a697bb113be9b9bdc39b29 /home/tomek/miniconda3/envs/mlflow-5987e03d4dbaa5faa1a697bb113be9b9bdc39b29\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda info --envs"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "c710e400",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"### Tworzenie środowiska\n",
|
||
|
"Środowisko można utworzyć i skonfigurować interaktywnie, lub z pliku `*.yml`"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 14,
|
||
|
"id": "8cd7d3f0",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Collecting package metadata (current_repodata.json): done\n",
|
||
|
"Solving environment: done\n",
|
||
|
"\n",
|
||
|
"## Package Plan ##\n",
|
||
|
"\n",
|
||
|
" environment location: /home/tomek/miniconda3/envs/hello_env\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"Preparing transaction: done\n",
|
||
|
"Verifying transaction: done\n",
|
||
|
"Executing transaction: done\n",
|
||
|
"#\n",
|
||
|
"# To activate this environment, use\n",
|
||
|
"#\n",
|
||
|
"# $ conda activate hello_env\n",
|
||
|
"#\n",
|
||
|
"# To deactivate an active environment, use\n",
|
||
|
"#\n",
|
||
|
"# $ conda deactivate\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda create --name hello_env -y"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "843c0104",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"### Aktywacja środowiska\n",
|
||
|
" - Żeby zmodyfikować środowisko albo zacząć z niego korzystać, musimy je aktywować.\n",
|
||
|
" - Aktywacja środowiska polega tak naprawdę na zmianie zmiennych środowiskowych, które mówią programom gdzie szukać ładowanych przez nie bibliotek i plików wykonywalnych, takich jak `PATH`, `PYTHON_PATH` itp.\n",
|
||
|
" - Po aktywowaniu środowiska w konsoli zobaczymy jego nazwę dopisaną na początku lini poleceń:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "a6adf414",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"```\n",
|
||
|
"$ conda activate hello_env\n",
|
||
|
"(hello_env) tomek@tomek-asus:/home$ python3 --version\n",
|
||
|
"Python 3.8.5\n",
|
||
|
"```"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "8457c95e",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Domyślnie wersja pythona będzie taka sama jak systemowa.\n",
|
||
|
"Żeby deaktywować środowisko, używamy `conda deactivate`:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "e3175dc3",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"```\n",
|
||
|
"$ conda deactivate\n",
|
||
|
"python3 --version\n",
|
||
|
"Python 3.8.5\n",
|
||
|
"```"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "753ff7e5",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"### Modyfikowanie środowiska\n",
|
||
|
"Jeśli chcemy stworzyc środowisko z inną wersją niż systemowa:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 22,
|
||
|
"id": "5b5b0ca0",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Collecting package metadata (current_repodata.json): done\n",
|
||
|
"Solving environment: done\n",
|
||
|
"\n",
|
||
|
"## Package Plan ##\n",
|
||
|
"\n",
|
||
|
" environment location: /home/tomek/miniconda3/envs/myenv\n",
|
||
|
"\n",
|
||
|
" added / updated specs:\n",
|
||
|
" - python=3.9\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"The following packages will be downloaded:\n",
|
||
|
"\n",
|
||
|
" package | build\n",
|
||
|
" ---------------------------|-----------------\n",
|
||
|
" _libgcc_mutex-0.1 | conda_forge 3 KB conda-forge\n",
|
||
|
" _openmp_mutex-4.5 | 1_gnu 22 KB conda-forge\n",
|
||
|
" ld_impl_linux-64-2.35.1 | hea4e1c9_2 618 KB conda-forge\n",
|
||
|
" libffi-3.3 | h58526e2_2 51 KB conda-forge\n",
|
||
|
" libgcc-ng-9.3.0 | h2828fa1_19 7.8 MB conda-forge\n",
|
||
|
" libgomp-9.3.0 | h2828fa1_19 376 KB conda-forge\n",
|
||
|
" libstdcxx-ng-9.3.0 | h6de172a_19 4.0 MB conda-forge\n",
|
||
|
" ncurses-6.2 | h58526e2_4 985 KB conda-forge\n",
|
||
|
" openssl-1.1.1k | h7f98852_0 2.1 MB conda-forge\n",
|
||
|
" pip-21.1.2 | pyhd8ed1ab_0 1.1 MB conda-forge\n",
|
||
|
" python-3.9.4 |hffdb5ce_0_cpython 27.4 MB conda-forge\n",
|
||
|
" readline-8.1 | h46c0cb4_0 295 KB conda-forge\n",
|
||
|
" setuptools-49.6.0 | py39hf3d152e_3 943 KB conda-forge\n",
|
||
|
" tk-8.6.10 | h21135ba_1 3.2 MB conda-forge\n",
|
||
|
" tzdata-2021a | he74cb21_0 121 KB conda-forge\n",
|
||
|
" wheel-0.36.2 | pyhd3deb0d_0 31 KB conda-forge\n",
|
||
|
" xz-5.2.5 | h516909a_1 343 KB conda-forge\n",
|
||
|
" zlib-1.2.11 | h516909a_1010 106 KB conda-forge\n",
|
||
|
" ------------------------------------------------------------\n",
|
||
|
" Total: 49.4 MB\n",
|
||
|
"\n",
|
||
|
"The following NEW packages will be INSTALLED:\n",
|
||
|
"\n",
|
||
|
" _libgcc_mutex conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge\n",
|
||
|
" _openmp_mutex conda-forge/linux-64::_openmp_mutex-4.5-1_gnu\n",
|
||
|
" ca-certificates conda-forge/linux-64::ca-certificates-2020.12.5-ha878542_0\n",
|
||
|
" certifi conda-forge/linux-64::certifi-2020.12.5-py39hf3d152e_1\n",
|
||
|
" ld_impl_linux-64 conda-forge/linux-64::ld_impl_linux-64-2.35.1-hea4e1c9_2\n",
|
||
|
" libffi conda-forge/linux-64::libffi-3.3-h58526e2_2\n",
|
||
|
" libgcc-ng conda-forge/linux-64::libgcc-ng-9.3.0-h2828fa1_19\n",
|
||
|
" libgomp conda-forge/linux-64::libgomp-9.3.0-h2828fa1_19\n",
|
||
|
" libstdcxx-ng conda-forge/linux-64::libstdcxx-ng-9.3.0-h6de172a_19\n",
|
||
|
" ncurses conda-forge/linux-64::ncurses-6.2-h58526e2_4\n",
|
||
|
" openssl conda-forge/linux-64::openssl-1.1.1k-h7f98852_0\n",
|
||
|
" pip conda-forge/noarch::pip-21.1.2-pyhd8ed1ab_0\n",
|
||
|
" python conda-forge/linux-64::python-3.9.4-hffdb5ce_0_cpython\n",
|
||
|
" python_abi conda-forge/linux-64::python_abi-3.9-1_cp39\n",
|
||
|
" readline conda-forge/linux-64::readline-8.1-h46c0cb4_0\n",
|
||
|
" setuptools conda-forge/linux-64::setuptools-49.6.0-py39hf3d152e_3\n",
|
||
|
" sqlite conda-forge/linux-64::sqlite-3.35.5-h74cdb3f_0\n",
|
||
|
" tk conda-forge/linux-64::tk-8.6.10-h21135ba_1\n",
|
||
|
" tzdata conda-forge/noarch::tzdata-2021a-he74cb21_0\n",
|
||
|
" wheel conda-forge/noarch::wheel-0.36.2-pyhd3deb0d_0\n",
|
||
|
" xz conda-forge/linux-64::xz-5.2.5-h516909a_1\n",
|
||
|
" zlib conda-forge/linux-64::zlib-1.2.11-h516909a_1010\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"Downloading and Extracting Packages\n",
|
||
|
"openssl-1.1.1k | 2.1 MB | ##################################### | 100% \n",
|
||
|
"_libgcc_mutex-0.1 | 3 KB | ##################################### | 100% \n",
|
||
|
"xz-5.2.5 | 343 KB | ##################################### | 100% \n",
|
||
|
"zlib-1.2.11 | 106 KB | ##################################### | 100% \n",
|
||
|
"tk-8.6.10 | 3.2 MB | ##################################### | 100% \n",
|
||
|
"python-3.9.4 | 27.4 MB | ##################################### | 100% \n",
|
||
|
"ncurses-6.2 | 985 KB | ##################################### | 100% \n",
|
||
|
"libstdcxx-ng-9.3.0 | 4.0 MB | ##################################### | 100% \n",
|
||
|
"tzdata-2021a | 121 KB | ##################################### | 100% \n",
|
||
|
"setuptools-49.6.0 | 943 KB | ##################################### | 100% \n",
|
||
|
"wheel-0.36.2 | 31 KB | ##################################### | 100% \n",
|
||
|
"_openmp_mutex-4.5 | 22 KB | ##################################### | 100% \n",
|
||
|
"libffi-3.3 | 51 KB | ##################################### | 100% \n",
|
||
|
"libgomp-9.3.0 | 376 KB | ##################################### | 100% \n",
|
||
|
"ld_impl_linux-64-2.3 | 618 KB | ##################################### | 100% \n",
|
||
|
"readline-8.1 | 295 KB | ##################################### | 100% \n",
|
||
|
"pip-21.1.2 | 1.1 MB | ##################################### | 100% \n",
|
||
|
"libgcc-ng-9.3.0 | 7.8 MB | ##################################### | 100% \n",
|
||
|
"Preparing transaction: done\n",
|
||
|
"Verifying transaction: done\n",
|
||
|
"Executing transaction: done\n",
|
||
|
"#\n",
|
||
|
"# To activate this environment, use\n",
|
||
|
"#\n",
|
||
|
"# $ conda activate myenv\n",
|
||
|
"#\n",
|
||
|
"# To deactivate an active environment, use\n",
|
||
|
"#\n",
|
||
|
"# $ conda deactivate\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda create -y -n myenv python=3.9"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "a3350d71",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Rzeczywiście, stworzone środowisko ma wersję Pythona z linii 3.9:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "ee072a93",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"```\n",
|
||
|
"$ conda activate myenv\n",
|
||
|
"(myenv)$ python3 --version\n",
|
||
|
"Python 3.9.4\n",
|
||
|
"```"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "89d443aa",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Tak samo, przy tworzeniu środowiska możemy podać inne zależności wraz z ich wersjami:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 25,
|
||
|
"id": "402c122e",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Collecting package metadata (current_repodata.json): done\n",
|
||
|
"Solving environment: done\n",
|
||
|
"\n",
|
||
|
"## Package Plan ##\n",
|
||
|
"\n",
|
||
|
" environment location: /home/tomek/miniconda3/envs/p39-mlflow-pandas\n",
|
||
|
"\n",
|
||
|
" added / updated specs:\n",
|
||
|
" - mlflow\n",
|
||
|
" - pandas=1.2.3\n",
|
||
|
" - python=3.9\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"The following packages will be downloaded:\n",
|
||
|
"\n",
|
||
|
" package | build\n",
|
||
|
" ---------------------------|-----------------\n",
|
||
|
" alembic-1.6.3 | pyhd8ed1ab_0 114 KB conda-forge\n",
|
||
|
" appdirs-1.4.4 | pyh9f0ad1d_0 13 KB conda-forge\n",
|
||
|
" asn1crypto-1.4.0 | pyh9f0ad1d_0 78 KB conda-forge\n",
|
||
|
" brotlipy-0.7.0 |py39h3811e60_1001 341 KB conda-forge\n",
|
||
|
" cffi-1.14.5 | py39he32792d_0 227 KB conda-forge\n",
|
||
|
" chardet-4.0.0 | py39hf3d152e_1 205 KB conda-forge\n",
|
||
|
" click-8.0.1 | py39hf3d152e_0 146 KB conda-forge\n",
|
||
|
" cloudpickle-1.6.0 | py_0 22 KB conda-forge\n",
|
||
|
" configparser-5.0.2 | pyhd8ed1ab_0 21 KB conda-forge\n",
|
||
|
" cryptography-3.4.7 | py39hbca0aa6_0 1.1 MB conda-forge\n",
|
||
|
" databricks-cli-0.9.1 | py_0 48 KB conda-forge\n",
|
||
|
" dataclasses-0.8 | pyhc8e2a94_1 7 KB conda-forge\n",
|
||
|
" docker-py-5.0.0 | py39hf3d152e_0 187 KB conda-forge\n",
|
||
|
" docker-pycreds-0.4.0 | py_0 11 KB conda-forge\n",
|
||
|
" entrypoints-0.3 | pyhd8ed1ab_1003 8 KB conda-forge\n",
|
||
|
" flask-2.0.1 | pyhd8ed1ab_0 70 KB conda-forge\n",
|
||
|
" gitdb-4.0.7 | pyhd8ed1ab_0 46 KB conda-forge\n",
|
||
|
" gitpython-3.1.17 | pyhd8ed1ab_0 115 KB conda-forge\n",
|
||
|
" gorilla-0.4.0 | pyhd8ed1ab_0 13 KB conda-forge\n",
|
||
|
" greenlet-1.1.0 | py39he80948d_0 84 KB conda-forge\n",
|
||
|
" gunicorn-20.1.0 | py39hf3d152e_0 119 KB conda-forge\n",
|
||
|
" idna-2.10 | pyh9f0ad1d_0 52 KB conda-forge\n",
|
||
|
" itsdangerous-2.0.1 | pyhd8ed1ab_0 17 KB conda-forge\n",
|
||
|
" jinja2-3.0.1 | pyhd8ed1ab_0 99 KB conda-forge\n",
|
||
|
" libblas-3.9.0 | 9_openblas 11 KB conda-forge\n",
|
||
|
" libcblas-3.9.0 | 9_openblas 11 KB conda-forge\n",
|
||
|
" libgfortran-ng-9.3.0 | hff62375_19 22 KB conda-forge\n",
|
||
|
" libgfortran5-9.3.0 | hff62375_19 2.0 MB conda-forge\n",
|
||
|
" liblapack-3.9.0 | 9_openblas 11 KB conda-forge\n",
|
||
|
" libopenblas-0.3.15 |pthreads_h8fe5266_1 9.2 MB conda-forge\n",
|
||
|
" libprotobuf-3.17.0 | h780b84a_0 2.5 MB conda-forge\n",
|
||
|
" mako-1.1.4 | pyh44b312d_0 58 KB conda-forge\n",
|
||
|
" markupsafe-2.0.1 | py39h3811e60_0 22 KB conda-forge\n",
|
||
|
" mlflow-1.2.0 | py_1 3.4 MB conda-forge\n",
|
||
|
" numpy-1.20.3 | py39hdbf815f_0 5.8 MB conda-forge\n",
|
||
|
" packaging-20.9 | pyh44b312d_0 35 KB conda-forge\n",
|
||
|
" pandas-1.2.3 | py39hde0f152_0 12.1 MB conda-forge\n",
|
||
|
" protobuf-3.17.0 | py39he80948d_0 346 KB conda-forge\n",
|
||
|
" pycparser-2.20 | pyh9f0ad1d_2 94 KB conda-forge\n",
|
||
|
" pyopenssl-20.0.1 | pyhd8ed1ab_0 48 KB conda-forge\n",
|
||
|
" pyparsing-2.4.7 | pyh9f0ad1d_0 60 KB conda-forge\n",
|
||
|
" pysocks-1.7.1 | py39hf3d152e_3 28 KB conda-forge\n",
|
||
|
" python-dateutil-2.8.1 | py_0 220 KB conda-forge\n",
|
||
|
" python-editor-1.0.4 | py_0 9 KB conda-forge\n",
|
||
|
" pytz-2021.1 | pyhd8ed1ab_0 239 KB conda-forge\n",
|
||
|
" pyyaml-5.4.1 | py39h3811e60_0 193 KB conda-forge\n",
|
||
|
" querystring_parser-1.2.4 | py_0 10 KB conda-forge\n",
|
||
|
" requests-2.25.1 | pyhd3deb0d_0 51 KB conda-forge\n",
|
||
|
" simplejson-3.17.2 | py39h3811e60_2 103 KB conda-forge\n",
|
||
|
" six-1.16.0 | pyh6c4a22f_0 14 KB conda-forge\n",
|
||
|
" smmap-3.0.5 | pyh44b312d_0 22 KB conda-forge\n",
|
||
|
" sqlalchemy-1.4.15 | py39h3811e60_0 2.3 MB conda-forge\n",
|
||
|
" sqlparse-0.4.1 | pyh9f0ad1d_0 34 KB conda-forge\n",
|
||
|
" tabulate-0.8.9 | pyhd8ed1ab_0 26 KB conda-forge\n",
|
||
|
" typing_extensions-3.7.4.3 | py_0 25 KB conda-forge\n",
|
||
|
" urllib3-1.26.4 | pyhd8ed1ab_0 99 KB conda-forge\n",
|
||
|
" websocket-client-0.57.0 | py39hf3d152e_4 59 KB conda-forge\n",
|
||
|
" werkzeug-2.0.1 | pyhd8ed1ab_0 219 KB conda-forge\n",
|
||
|
" yaml-0.2.5 | h516909a_0 82 KB conda-forge\n",
|
||
|
" ------------------------------------------------------------\n",
|
||
|
" Total: 42.3 MB\n",
|
||
|
"\n",
|
||
|
"The following NEW packages will be INSTALLED:\n",
|
||
|
"\n",
|
||
|
" _libgcc_mutex conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge\n",
|
||
|
" _openmp_mutex conda-forge/linux-64::_openmp_mutex-4.5-1_gnu\n",
|
||
|
" alembic conda-forge/noarch::alembic-1.6.3-pyhd8ed1ab_0\n",
|
||
|
" appdirs conda-forge/noarch::appdirs-1.4.4-pyh9f0ad1d_0\n",
|
||
|
" asn1crypto conda-forge/noarch::asn1crypto-1.4.0-pyh9f0ad1d_0\n",
|
||
|
" brotlipy conda-forge/linux-64::brotlipy-0.7.0-py39h3811e60_1001\n",
|
||
|
" ca-certificates conda-forge/linux-64::ca-certificates-2020.12.5-ha878542_0\n",
|
||
|
" certifi conda-forge/linux-64::certifi-2020.12.5-py39hf3d152e_1\n",
|
||
|
" cffi conda-forge/linux-64::cffi-1.14.5-py39he32792d_0\n",
|
||
|
" chardet conda-forge/linux-64::chardet-4.0.0-py39hf3d152e_1\n",
|
||
|
" click conda-forge/linux-64::click-8.0.1-py39hf3d152e_0\n",
|
||
|
" cloudpickle conda-forge/noarch::cloudpickle-1.6.0-py_0\n",
|
||
|
" configparser conda-forge/noarch::configparser-5.0.2-pyhd8ed1ab_0\n",
|
||
|
" cryptography conda-forge/linux-64::cryptography-3.4.7-py39hbca0aa6_0\n",
|
||
|
" databricks-cli conda-forge/noarch::databricks-cli-0.9.1-py_0\n",
|
||
|
" dataclasses conda-forge/noarch::dataclasses-0.8-pyhc8e2a94_1\n",
|
||
|
" docker-py conda-forge/linux-64::docker-py-5.0.0-py39hf3d152e_0\n",
|
||
|
" docker-pycreds conda-forge/noarch::docker-pycreds-0.4.0-py_0\n",
|
||
|
" entrypoints conda-forge/noarch::entrypoints-0.3-pyhd8ed1ab_1003\n",
|
||
|
" flask conda-forge/noarch::flask-2.0.1-pyhd8ed1ab_0\n",
|
||
|
" gitdb conda-forge/noarch::gitdb-4.0.7-pyhd8ed1ab_0\n",
|
||
|
" gitpython conda-forge/noarch::gitpython-3.1.17-pyhd8ed1ab_0\n",
|
||
|
" gorilla conda-forge/noarch::gorilla-0.4.0-pyhd8ed1ab_0\n",
|
||
|
" greenlet conda-forge/linux-64::greenlet-1.1.0-py39he80948d_0\n",
|
||
|
" gunicorn conda-forge/linux-64::gunicorn-20.1.0-py39hf3d152e_0\n",
|
||
|
" idna conda-forge/noarch::idna-2.10-pyh9f0ad1d_0\n",
|
||
|
" itsdangerous conda-forge/noarch::itsdangerous-2.0.1-pyhd8ed1ab_0\n",
|
||
|
" jinja2 conda-forge/noarch::jinja2-3.0.1-pyhd8ed1ab_0\n",
|
||
|
" ld_impl_linux-64 conda-forge/linux-64::ld_impl_linux-64-2.35.1-hea4e1c9_2\n",
|
||
|
" libblas conda-forge/linux-64::libblas-3.9.0-9_openblas\n",
|
||
|
" libcblas conda-forge/linux-64::libcblas-3.9.0-9_openblas\n",
|
||
|
" libffi conda-forge/linux-64::libffi-3.3-h58526e2_2\n",
|
||
|
" libgcc-ng conda-forge/linux-64::libgcc-ng-9.3.0-h2828fa1_19\n",
|
||
|
" libgfortran-ng conda-forge/linux-64::libgfortran-ng-9.3.0-hff62375_19\n",
|
||
|
" libgfortran5 conda-forge/linux-64::libgfortran5-9.3.0-hff62375_19\n",
|
||
|
" libgomp conda-forge/linux-64::libgomp-9.3.0-h2828fa1_19\n",
|
||
|
" liblapack conda-forge/linux-64::liblapack-3.9.0-9_openblas\n",
|
||
|
" libopenblas conda-forge/linux-64::libopenblas-0.3.15-pthreads_h8fe5266_1\n",
|
||
|
" libprotobuf conda-forge/linux-64::libprotobuf-3.17.0-h780b84a_0\n",
|
||
|
" libstdcxx-ng conda-forge/linux-64::libstdcxx-ng-9.3.0-h6de172a_19\n",
|
||
|
" mako conda-forge/noarch::mako-1.1.4-pyh44b312d_0\n",
|
||
|
" markupsafe conda-forge/linux-64::markupsafe-2.0.1-py39h3811e60_0\n",
|
||
|
" mlflow conda-forge/noarch::mlflow-1.2.0-py_1\n",
|
||
|
" ncurses conda-forge/linux-64::ncurses-6.2-h58526e2_4\n",
|
||
|
" numpy conda-forge/linux-64::numpy-1.20.3-py39hdbf815f_0\n",
|
||
|
" openssl conda-forge/linux-64::openssl-1.1.1k-h7f98852_0\n",
|
||
|
" packaging conda-forge/noarch::packaging-20.9-pyh44b312d_0\n",
|
||
|
" pandas conda-forge/linux-64::pandas-1.2.3-py39hde0f152_0\n",
|
||
|
" pip conda-forge/noarch::pip-21.1.2-pyhd8ed1ab_0\n",
|
||
|
" protobuf conda-forge/linux-64::protobuf-3.17.0-py39he80948d_0\n",
|
||
|
" pycparser conda-forge/noarch::pycparser-2.20-pyh9f0ad1d_2\n",
|
||
|
" pyopenssl conda-forge/noarch::pyopenssl-20.0.1-pyhd8ed1ab_0\n",
|
||
|
" pyparsing conda-forge/noarch::pyparsing-2.4.7-pyh9f0ad1d_0\n",
|
||
|
" pysocks conda-forge/linux-64::pysocks-1.7.1-py39hf3d152e_3\n",
|
||
|
" python conda-forge/linux-64::python-3.9.4-hffdb5ce_0_cpython\n",
|
||
|
" python-dateutil conda-forge/noarch::python-dateutil-2.8.1-py_0\n",
|
||
|
" python-editor conda-forge/noarch::python-editor-1.0.4-py_0\n",
|
||
|
" python_abi conda-forge/linux-64::python_abi-3.9-1_cp39\n",
|
||
|
" pytz conda-forge/noarch::pytz-2021.1-pyhd8ed1ab_0\n",
|
||
|
" pyyaml conda-forge/linux-64::pyyaml-5.4.1-py39h3811e60_0\n",
|
||
|
" querystring_parser conda-forge/noarch::querystring_parser-1.2.4-py_0\n",
|
||
|
" readline conda-forge/linux-64::readline-8.1-h46c0cb4_0\n",
|
||
|
" requests conda-forge/noarch::requests-2.25.1-pyhd3deb0d_0\n",
|
||
|
" setuptools conda-forge/linux-64::setuptools-49.6.0-py39hf3d152e_3\n",
|
||
|
" simplejson conda-forge/linux-64::simplejson-3.17.2-py39h3811e60_2\n",
|
||
|
" six conda-forge/noarch::six-1.16.0-pyh6c4a22f_0\n",
|
||
|
" smmap conda-forge/noarch::smmap-3.0.5-pyh44b312d_0\n",
|
||
|
" sqlalchemy conda-forge/linux-64::sqlalchemy-1.4.15-py39h3811e60_0\n",
|
||
|
" sqlite conda-forge/linux-64::sqlite-3.35.5-h74cdb3f_0\n",
|
||
|
" sqlparse conda-forge/noarch::sqlparse-0.4.1-pyh9f0ad1d_0\n",
|
||
|
" tabulate conda-forge/noarch::tabulate-0.8.9-pyhd8ed1ab_0\n",
|
||
|
" tk conda-forge/linux-64::tk-8.6.10-h21135ba_1\n",
|
||
|
" typing_extensions conda-forge/noarch::typing_extensions-3.7.4.3-py_0\n",
|
||
|
" tzdata conda-forge/noarch::tzdata-2021a-he74cb21_0\n",
|
||
|
" urllib3 conda-forge/noarch::urllib3-1.26.4-pyhd8ed1ab_0\n",
|
||
|
" websocket-client conda-forge/linux-64::websocket-client-0.57.0-py39hf3d152e_4\n",
|
||
|
" werkzeug conda-forge/noarch::werkzeug-2.0.1-pyhd8ed1ab_0\n",
|
||
|
" wheel conda-forge/noarch::wheel-0.36.2-pyhd3deb0d_0\n",
|
||
|
" xz conda-forge/linux-64::xz-5.2.5-h516909a_1\n",
|
||
|
" yaml conda-forge/linux-64::yaml-0.2.5-h516909a_0\n",
|
||
|
" zlib conda-forge/linux-64::zlib-1.2.11-h516909a_1010\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"Downloading and Extracting Packages\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"smmap-3.0.5 | 22 KB | ##################################### | 100% \n",
|
||
|
"sqlalchemy-1.4.15 | 2.3 MB | ##################################### | 100% \n",
|
||
|
"appdirs-1.4.4 | 13 KB | ##################################### | 100% \n",
|
||
|
"gunicorn-20.1.0 | 119 KB | ##################################### | 100% \n",
|
||
|
"pyopenssl-20.0.1 | 48 KB | ##################################### | 100% \n",
|
||
|
"mako-1.1.4 | 58 KB | ##################################### | 100% \n",
|
||
|
"libopenblas-0.3.15 | 9.2 MB | ##################################### | 100% \n",
|
||
|
"libcblas-3.9.0 | 11 KB | ##################################### | 100% \n",
|
||
|
"gitdb-4.0.7 | 46 KB | ##################################### | 100% \n",
|
||
|
"click-8.0.1 | 146 KB | ##################################### | 100% \n",
|
||
|
"gorilla-0.4.0 | 13 KB | ##################################### | 100% \n",
|
||
|
"gitpython-3.1.17 | 115 KB | ##################################### | 100% \n",
|
||
|
"typing_extensions-3. | 25 KB | ##################################### | 100% \n",
|
||
|
"pysocks-1.7.1 | 28 KB | ##################################### | 100% \n",
|
||
|
"pandas-1.2.3 | 12.1 MB | ##################################### | 100% \n",
|
||
|
"libgfortran-ng-9.3.0 | 22 KB | ##################################### | 100% \n",
|
||
|
"docker-pycreds-0.4.0 | 11 KB | ##################################### | 100% \n",
|
||
|
"docker-py-5.0.0 | 187 KB | ##################################### | 100% \n",
|
||
|
"itsdangerous-2.0.1 | 17 KB | ##################################### | 100% \n",
|
||
|
"configparser-5.0.2 | 21 KB | ##################################### | 100% \n",
|
||
|
"sqlparse-0.4.1 | 34 KB | ##################################### | 100% \n",
|
||
|
"werkzeug-2.0.1 | 219 KB | ##################################### | 100% \n",
|
||
|
"alembic-1.6.3 | 114 KB | ##################################### | 100% \n",
|
||
|
"tabulate-0.8.9 | 26 KB | ##################################### | 100% \n",
|
||
|
"cloudpickle-1.6.0 | 22 KB | ##################################### | 100% \n",
|
||
|
"asn1crypto-1.4.0 | 78 KB | ##################################### | 100% \n",
|
||
|
"brotlipy-0.7.0 | 341 KB | ##################################### | 100% \n",
|
||
|
"dataclasses-0.8 | 7 KB | ##################################### | 100% \n",
|
||
|
"cryptography-3.4.7 | 1.1 MB | ##################################### | 100% \n",
|
||
|
"pycparser-2.20 | 94 KB | ##################################### | 100% \n",
|
||
|
"libprotobuf-3.17.0 | 2.5 MB | ##################################### | 100% \n",
|
||
|
"simplejson-3.17.2 | 103 KB | ##################################### | 100% \n",
|
||
|
"requests-2.25.1 | 51 KB | ##################################### | 100% \n",
|
||
|
"pytz-2021.1 | 239 KB | ##################################### | 100% \n",
|
||
|
"flask-2.0.1 | 70 KB | ##################################### | 100% \n",
|
||
|
"numpy-1.20.3 | 5.8 MB | ##################################### | 100% \n",
|
||
|
"markupsafe-2.0.1 | 22 KB | ##################################### | 100% \n",
|
||
|
"idna-2.10 | 52 KB | ##################################### | 100% \n",
|
||
|
"six-1.16.0 | 14 KB | ##################################### | 100% \n",
|
||
|
"libgfortran5-9.3.0 | 2.0 MB | ##################################### | 100% \n",
|
||
|
"liblapack-3.9.0 | 11 KB | ##################################### | 100% \n",
|
||
|
"pyparsing-2.4.7 | 60 KB | ##################################### | 100% \n",
|
||
|
"packaging-20.9 | 35 KB | ##################################### | 100% \n",
|
||
|
"jinja2-3.0.1 | 99 KB | ##################################### | 100% \n",
|
||
|
"chardet-4.0.0 | 205 KB | ##################################### | 100% \n",
|
||
|
"protobuf-3.17.0 | 346 KB | ##################################### | 100% \n",
|
||
|
"urllib3-1.26.4 | 99 KB | ##################################### | 100% \n",
|
||
|
"pyyaml-5.4.1 | 193 KB | ##################################### | 100% \n",
|
||
|
"databricks-cli-0.9.1 | 48 KB | ##################################### | 100% \n",
|
||
|
"websocket-client-0.5 | 59 KB | ##################################### | 100% \n",
|
||
|
"python-dateutil-2.8. | 220 KB | ##################################### | 100% \n",
|
||
|
"greenlet-1.1.0 | 84 KB | ##################################### | 100% \n",
|
||
|
"entrypoints-0.3 | 8 KB | ##################################### | 100% \n",
|
||
|
"yaml-0.2.5 | 82 KB | ##################################### | 100% \n",
|
||
|
"libblas-3.9.0 | 11 KB | ##################################### | 100% \n",
|
||
|
"mlflow-1.2.0 | 3.4 MB | ##################################### | 100% \n",
|
||
|
"cffi-1.14.5 | 227 KB | ##################################### | 100% \n",
|
||
|
"python-editor-1.0.4 | 9 KB | ##################################### | 100% \n",
|
||
|
"querystring_parser-1 | 10 KB | ##################################### | 100% \n",
|
||
|
"Preparing transaction: done\n",
|
||
|
"Verifying transaction: done\n",
|
||
|
"Executing transaction: done\n",
|
||
|
"#\n",
|
||
|
"# To activate this environment, use\n",
|
||
|
"#\n",
|
||
|
"# $ conda activate p39-mlflow-pandas\n",
|
||
|
"#\n",
|
||
|
"# To deactivate an active environment, use\n",
|
||
|
"#\n",
|
||
|
"# $ conda deactivate\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda create -y -n p39-mlflow-pandas python=3.9 pandas=1.2.3 mlflow"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "4f9b7b29",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Możemy podać jakie pakiety i w jakich wersjach mają być domyślnie dodawane do nowo tworzonych środowisk za pomocą sekcji [create_default_package](https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#config-add-default-pkgs) w pliku [`~/.condarc`](https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "50346792",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"```\n",
|
||
|
"create_default_packages:\n",
|
||
|
" - python=3.9\n",
|
||
|
" - pandas=1.2.3\n",
|
||
|
" - mlflow\n",
|
||
|
"```"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "01a9ea21",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Doinstalowanie nowych pakietów może odbyć się poprzez:\n",
|
||
|
" - `conda install mlflow` - wywołane w aktywowanym środowisku\n",
|
||
|
" - `conda install -n myenv mlflow` - wywołane spoza atkywanego środowiska (instaluje mlflow w środowisku `myenv`)\n",
|
||
|
" - `pip install` - jeśli w środowisku mamy zainstalowane polecenie `pip` - używamy `pip` tylko, jeśli pakiet nie jest dostępny w repozytoriach conda. Uwagi dotyczące używania `pip` razem z Conda: [link](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#using-pip-in-an-environment)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "7ec5430e",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"#### Klonowanie środowiska\n",
|
||
|
"Istniejące środowisko można skopiować:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"id": "18f72668",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"conda create --name myclone --clone myenv\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "3bcaf2e6",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"### Eksportowanie środowisk\n",
|
||
|
"- Definicję środowiska można wyeksportować do pliku `*.yml`, który może potem posłużyć do jego odtworzenia\n",
|
||
|
"- Takie pliki są np. wykorzystywane przez MLflow"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 26,
|
||
|
"id": "f901b34b",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"name: myenv\n",
|
||
|
"channels:\n",
|
||
|
" - conda-forge\n",
|
||
|
" - defaults\n",
|
||
|
"dependencies:\n",
|
||
|
" - _libgcc_mutex=0.1=conda_forge\n",
|
||
|
" - _openmp_mutex=4.5=1_gnu\n",
|
||
|
" - ca-certificates=2020.12.5=ha878542_0\n",
|
||
|
" - certifi=2020.12.5=py39hf3d152e_1\n",
|
||
|
" - ld_impl_linux-64=2.35.1=hea4e1c9_2\n",
|
||
|
" - libffi=3.3=h58526e2_2\n",
|
||
|
" - libgcc-ng=9.3.0=h2828fa1_19\n",
|
||
|
" - libgomp=9.3.0=h2828fa1_19\n",
|
||
|
" - libstdcxx-ng=9.3.0=h6de172a_19\n",
|
||
|
" - ncurses=6.2=h58526e2_4\n",
|
||
|
" - openssl=1.1.1k=h7f98852_0\n",
|
||
|
" - pip=21.1.2=pyhd8ed1ab_0\n",
|
||
|
" - python=3.9.4=hffdb5ce_0_cpython\n",
|
||
|
" - python_abi=3.9=1_cp39\n",
|
||
|
" - readline=8.1=h46c0cb4_0\n",
|
||
|
" - setuptools=49.6.0=py39hf3d152e_3\n",
|
||
|
" - sqlite=3.35.5=h74cdb3f_0\n",
|
||
|
" - tk=8.6.10=h21135ba_1\n",
|
||
|
" - tzdata=2021a=he74cb21_0\n",
|
||
|
" - wheel=0.36.2=pyhd3deb0d_0\n",
|
||
|
" - xz=5.2.5=h516909a_1\n",
|
||
|
" - zlib=1.2.11=h516909a_1010\n",
|
||
|
"prefix: /home/tomek/miniconda3/envs/myenv\n",
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda env export -n myenv"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "c9fb78ca",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"Normalnie, zapisalibyśmy wyni eksportu do pliku:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 31,
|
||
|
"id": "048760fd",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda env export -n myenv > myenv.yml"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "7e3c1e11",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"#### Eksport między systemami\n",
|
||
|
" - Jeśli chcemy zapeniwć, że nasze środowisko będzie można odtworzyć na innym systemie, musimy uyżyć flagi `--from-history`\n",
|
||
|
" - Użycie tej flagi spowoduje eksport jedynie tych zależności, które explicite instalowaliśmy (bez ich zależności, które mogą być niekompatybilne między systemami)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 29,
|
||
|
"id": "43fcb023",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"name: base\n",
|
||
|
"channels:\n",
|
||
|
" - conda-forge\n",
|
||
|
" - defaults\n",
|
||
|
"dependencies:\n",
|
||
|
" - conda\n",
|
||
|
" - python=3.9\n",
|
||
|
" - jupyter\n",
|
||
|
" - rise\n",
|
||
|
" - anaconda-navigator\n",
|
||
|
"prefix: /home/tomek/miniconda3\n",
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda env export --from-history #Jeśli nie podamy nazwy środowiska, eksportujemy aktywne środowisko"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "9b67fddd",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"### Tworzenie środowiska z pliku `*.yml`\n",
|
||
|
"Mając plik `*.yml` wyeksportowany za pomocą `conda env export` albo stworzony/zmodyfikowane [ręcznie](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#create-env-file-manually), możemy utworzyć na jego podstawie środowisko:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 32,
|
||
|
"id": "4a4ce330",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Collecting package metadata (repodata.json): done\n",
|
||
|
"Solving environment: done\n",
|
||
|
"Preparing transaction: done\n",
|
||
|
"Verifying transaction: done\n",
|
||
|
"Executing transaction: done\n",
|
||
|
"#\n",
|
||
|
"# To activate this environment, use\n",
|
||
|
"#\n",
|
||
|
"# $ conda activate myenv_from_file\n",
|
||
|
"#\n",
|
||
|
"# To deactivate an active environment, use\n",
|
||
|
"#\n",
|
||
|
"# $ conda deactivate\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"Note: you may need to restart the kernel to use updated packages.\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"conda env create -n myenv_from_file -f myenv.yml"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"id": "f37e7aa7",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Zadania\n",
|
||
|
"1. Zainstaluj Anaconda lub Miniconda na swoim komputerze\n",
|
||
|
"2. Stwórz środowisko zawierające wszystkie zależności wymagane przez stworzone na zajęciach skrypty/programy\n",
|
||
|
"3. Wyeksportuj środowisko do pliku `environment.yml` i dodaj ten plik do repozytorium"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3",
|
||
|
"language": "python",
|
||
|
"name": "python3"
|
||
|
},
|
||
|
"language_info": {
|
||
|
"codemirror_mode": {
|
||
|
"name": "ipython",
|
||
|
"version": 3
|
||
|
},
|
||
|
"file_extension": ".py",
|
||
|
"mimetype": "text/x-python",
|
||
|
"name": "python",
|
||
|
"nbconvert_exporter": "python",
|
||
|
"pygments_lexer": "ipython3",
|
||
|
"version": "3.9.1"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 5
|
||
|
}
|