Can Anaconda be used as a sandbox environment for Python?

Asked 1 years ago, Updated 1 years ago, 312 views

I want to create an environment like Python sandbox on Linux.
Is it the right decision to deploy Anaconda to build the environment without destroying the original environment?
Anaconda can create a virtual environment, so I think it works like a sandbox.
Thank you for your cooperation.

It may have been wrong to describe it as a sandbox.
I would like to know if Anaconda has isolated the Python packaging environment from its original environment.
When I install the Python package, I'm thinking of using Anaconda to keep the server environment intact. Is this the correct method?

python anaconda

2022-12-27 08:20

1 Answers

If you answer briefly, yes, you can.However, the situation is a little complicated, so I will explain it clearly.

Some versions of the python command are managed first in Python sandboxes or virtual environments, and others are managed in addition to the version of the package group.What the questioner wants to use this time is the latter management tool.

As a tool for creating such a virtual environment, the Python formula provides venv: https://docs.python.org/ja/3/library/venv.html. You can use venv to fix the version of the python command after enabling the virtual environment, or separate or install the package.

Pipenv and Poetry are also known as third-party package management tools that combine venv and pip capabilities.These features are not discussed here, but they were created for features that venv+pip does not have.

By the way, we've been saying packages, but venv, Pipenv, and Poetry are all packages that are managed in the format PyPIhttps://pypi.org/.What makes Anaconda different is this part, which uses the packaging mechanism that Anaconda manages independently.For more information, read this article: "Understanding Conda and Pip" (2018-11-28).

In other words, you can create a virtual environment with Anaconda, but the virtual environment is what Anaconda calls a package family environment, not a package environment that is specifically installed with pip install.

If you are aware of the circumstances so far and want to use Anaconda's virtual environment, here are the documents: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html. Try creating a virtual environment from conda create.

If you want to use a PyPI package, you can choose the advantages and disadvantages from tools such as venv.For example, the following blog posts are helpful: "Technical and historical background and perspective of pip and pipenv and poetry" (2021-03-29).


2022-12-27 09:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.