Conda/ru: Difference between revisions

From FreeCAD Documentation
(Created page with "==Мотивация==")
(Created page with "Рассмотрим более подробно.")
 
(6 intermediate revisions by the same user not shown)
Line 11: Line 11:
See also a [https://www.youtube.com/watch?v=sCs8xlrw2nM video tutorial] of the contents of this page
See also a [https://www.youtube.com/watch?v=sCs8xlrw2nM video tutorial] of the contents of this page


==Аргументы в пользу Conda==
==Мотивация==


The motivation for using Conda is multi-fold, as is Conda's purpose.
The motivation for using Conda is multi-fold, as is Conda's purpose.


Рассмотрим более подробно.
Let's break it down.


===Conda as a Package Manager===
===Conda как пакетный менеджер===


First, Conda is a package manager -- similar to <code>apt</code> or <code>pip</code>.
First, Conda is a package manager -- similar to <code>apt</code> or <code>pip</code>.
Line 25: Line 25:
Conda Forge is analogous to [https://pypi.org/ the Python Package Index (PyPI)], a community channel made up of thousands of contributors, and serves [https://anaconda.org/conda-forge/freecad freecad] as a conda package.
Conda Forge is analogous to [https://pypi.org/ the Python Package Index (PyPI)], a community channel made up of thousands of contributors, and serves [https://anaconda.org/conda-forge/freecad freecad] as a conda package.


===Conda as a Dependency Manager===
===Conda как менеджер зависимостей===


Next, Conda is a dependency manager, also similar to <code>apt</code> or <code>pip</code>.
Next, Conda is a dependency manager, also similar to <code>apt</code> or <code>pip</code>.
Line 35: Line 35:
Conda works for multiple languages, and is therefore better suited for managing the dependencies of projects like FreeCAD that have dependencies across a variety of languages like C / C++ and Python.
Conda works for multiple languages, and is therefore better suited for managing the dependencies of projects like FreeCAD that have dependencies across a variety of languages like C / C++ and Python.


===Conda as a Environment Manager===
===Conda как менеджер среды окружения===


Conda has the concept of an [https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/environments.html environment] which is the unique combination of packages and versions needed to run a piece of software. For example, a FreeCAD workbench.
Conda has the concept of an [https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/environments.html environment] which is the unique combination of packages and versions needed to run a piece of software. For example, a FreeCAD workbench.
Line 47: Line 47:
For example, multiple local developer machines, or a remote build-server hosted by Travis CI.
For example, multiple local developer machines, or a remote build-server hosted by Travis CI.


==Installing Conda==
==Установка Conda==


1. [https://docs.conda.io/en/latest/miniconda.html Install Miniconda].
1. [https://docs.conda.io/en/latest/miniconda.html Install Miniconda].
Line 90: Line 90:
* [https://forum.freecadweb.org/viewtopic.php?f=8&t=45582 FreeCAD Conda Distribution]
* [https://forum.freecadweb.org/viewtopic.php?f=8&t=45582 FreeCAD Conda Distribution]


==Смотрите Также==
==See Also==


* https://docs.conda.io/en/latest/
* https://docs.conda.io/en/latest/

Latest revision as of 08:29, 4 September 2022

Other languages:

Вступление

This page is meant to introduce Conda as a package, dependency, and environment manager for FreeCAD.

Currently this page mainly catalogs links to relevant FreeCAD forum discussion and other places on the web, but the hope is to document the salient points from those links into this page.

See also a video tutorial of the contents of this page

Аргументы в пользу Conda

The motivation for using Conda is multi-fold, as is Conda's purpose.

Рассмотрим более подробно.

Conda как пакетный менеджер

First, Conda is a package manager -- similar to apt or pip.

This means we can install packages with a a simple conda install from various channels such as conda-forge.

Conda Forge is analogous to the Python Package Index (PyPI), a community channel made up of thousands of contributors, and serves freecad as a conda package.

Conda как менеджер зависимостей

Next, Conda is a dependency manager, also similar to apt or pip.

Conda can manage the dependencies and install the dependencies for a project like FreeCAD.

Why not just use pip? pip works really well for managing the dependencies of projects that only use python.

Conda works for multiple languages, and is therefore better suited for managing the dependencies of projects like FreeCAD that have dependencies across a variety of languages like C / C++ and Python.

Conda как менеджер среды окружения

Conda has the concept of an environment which is the unique combination of packages and versions needed to run a piece of software. For example, a FreeCAD workbench.

With environments, you can easily "activate" and "deactivate" them, or switch between versions of packages needed for particular pieces of software.

This is useful for testing how a workbench behaves with a particular set of packages. For example, how does a workbench behave in FreeCAD 18.4 vs 19?

Conda environments allow you to reproduce the same exact environment on different machines.

For example, multiple local developer machines, or a remote build-server hosted by Travis CI.

Установка Conda

1. Install Miniconda.

2. Verify your installation was successful and familiarize yourself with the conda CLI. $ conda --help

Installing FreeCAD Using Conda

First, you need to decide whether you want to install a stable version of FreeCAD, or experiment with the latest unstable code from FreeCAD master.

Stable released versions of FreeCAD are served on the conda-forge channel, while the latest from FreeCAD master is served on the freecad/label/dev channel.

Conda Channel Stable?
conda-forge Yes ✔️
freecad/label/dev No ❌

Secondly, since you can easily create dedicated environments in conda, it's recommended to create one for FreeCAD.

The create command allows you to create an environment from a list of specified packages. In our case, we want to create an environment called "fcenv" (short for FreeCAD environment) from the freecad package, and tell conda to search for the freecad package using the conda-forge channel.

conda create --name fcenv --channel conda-forge freecad

Tip: You can alternatively tell conda to always search conda-forge when installing packages with the following command:

conda config --add channels conda-forge

The weekly builds can be installed from the freecad/label/dev channel like so:

conda create --name fcenv-dev --channel freecad/label/dev freecad

FreeCAD Forum Discussion

Смотрите Также