Back to Article List

How to create and manage Miniconda environments

How to create and manage Miniconda environments

Everything useful you do with Miniconda happens inside environments. The installer ships little beyond conda and one Python on purpose: the intended workflow is an isolated environment per project, each with its own pinned interpreter, so one project's dependencies never leak into the next. This guide runs through that lifecycle on a standard install in ~/miniconda3. No install yet? The guide to install Miniconda on Ubuntu gets you there first.

Create an environment with conda create

Every project starts here:

conda create -n myproject python=3.12

-n names the environment, and the python=3.12 part shouldn't be treated as optional. A bare conda create -n myproject produces an environment with no Python in it at all, which catches nearly everyone once. The pin also carries the reproducibility: six months on, on another machine, the same command builds the same interpreter instead of whatever was newest that day. (Sometimes the pin points backward, python=3.11 for a dependency that hasn't caught up, and that situation comes up more often than library changelogs admit.)

Conda prints its plan and asks for confirmation before doing anything. -y skips the prompt, which scripts want and interactive fingers eventually regret.

Activate and deactivate the environment

Nothing you created is in use until you activate it:

conda activate myproject

The prompt prefix changes from (base) to (myproject), and which python now answers with ~/miniconda3/envs/myproject/bin/python. I've gotten into the habit of running that path check before any pip install, just to confirm I'm where I think I am. conda deactivate drops you back to base when you're done.

Your idea deserves better hosting

24/7 support 30-day money-back guaranteeRefund covers the VPS plan on your first order. Cancel anytime
Строк Оплати

VPS.S1

$5.99 Save  17 %
$4.99 Щомісячно
  • 2 vCPU AMD EPYC
  • 2 GB RAMПАМʼЯТЬ
  • 30 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено

VPS.S3

$14.99 Save  33 %
$9.99 Щомісячно
  • 4 vCPU AMD EPYC
  • 6 GB RAMПАМʼЯТЬ
  • 70 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено

VPS.S4

$19.99 Save  20 %
$15.99 Щомісячно
  • 6 vCPU AMD EPYC
  • 8 GB RAMПАМʼЯТЬ
  • 80 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено

EPYC VPS.P1

$8.99 Save  22 %
$6.99 Щомісячно
  • 2 vCPU AMD EPYC
  • 4 GB RAMПАМʼЯТЬ
  • 40 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено
  • Безкоштовний авто бекапМістить один слот резервного копіювання, який можна налаштувати на щоденний, щотижневий або щомісячний запуск.

EPYC VPS.P2

$16.99 Save  24 %
$12.99 Щомісячно
  • 2 vCPU AMD EPYC
  • 8 GB RAMПАМʼЯТЬ
  • 80 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено
  • Безкоштовний авто бекапМістить один слот резервного копіювання, який можна налаштувати на щоденний, щотижневий або щомісячний запуск.

EPYC VPS.P4

$29.99 Save  23 %
$22.99 Щомісячно
  • 4 vCPU AMD EPYC
  • 16 GB RAMПАМʼЯТЬ
  • 160 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено
  • Безкоштовний авто бекапМістить один слот резервного копіювання, який можна налаштувати на щоденний, щотижневий або щомісячний запуск.

EPYC VPS.P5

$39.99 Save  25 %
$29.99 Щомісячно
  • 8 vCPU AMD EPYC
  • 16 GB RAMПАМʼЯТЬ
  • 180 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено
  • Безкоштовний авто бекапМістить один слот резервного копіювання, який можна налаштувати на щоденний, щотижневий або щомісячний запуск.

EPYC VPS.P6

$59.99 Save  25 %
$44.99 Щомісячно
  • 8 vCPU AMD EPYC
  • 32 GB RAMПАМʼЯТЬ
  • 200 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено
  • Безкоштовний авто бекапМістить один слот резервного копіювання, який можна налаштувати на щоденний, щотижневий або щомісячний запуск.

EPYC VPS.P7

$69.99 Save  29 %
$49.99 Щомісячно
  • 16 vCPU AMD EPYC
  • 32 GB RAMПАМʼЯТЬ
  • 240 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено
  • Безкоштовний авто бекапМістить один слот резервного копіювання, який можна налаштувати на щоденний, щотижневий або щомісячний запуск.

Genoa VPS.G2

$24.99 Save  20 %
$19.99 Щомісячно
  • 2 vCPUAMD EPYC Genoa 4-го покоління 9xx4 з 3,25 GHz або подібний, на архітектурі Zen 4. AMD EPYC G4
  • 4 GB DDR5ПАМʼЯТЬ
  • 50 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено
  • Безкоштовний авто бекапМістить один слот резервного копіювання, який можна налаштувати на щоденний, щотижневий або щомісячний запуск.

Genoa VPS.G4

$44.99 Save  22 %
$34.99 Щомісячно
  • 4 vCPUПроцесор AMD EPYC з виділеними ядрами vCPU, на серверному обладнанні корпоративного класу. AMD EPYC G4
  • 8 GB DDR5ПАМʼЯТЬ
  • 100 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено
  • Безкоштовний авто бекапМістить один слот резервного копіювання, який можна налаштувати на щоденний, щотижневий або щомісячний запуск.

Genoa VPS.G6

$89.99 Save  22 %
$69.99 Щомісячно
  • 8 vCPUПроцесор AMD EPYC з виділеними ядрами vCPU, на серверному обладнанні корпоративного класу. AMD EPYC G4
  • 16 GB DDR5ПАМʼЯТЬ
  • 200 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено
  • Безкоштовний авто бекапМістить один слот резервного копіювання, який можна налаштувати на щоденний, щотижневий або щомісячний запуск.

Genoa VPS.G7

$159.99 Save  22 %
$124.99 Щомісячно
  • 8 vCPUПроцесор AMD EPYC з виділеними ядрами vCPU, на серверному обладнанні корпоративного класу. AMD EPYC G4
  • 32 GB DDR5ПАМʼЯТЬ
  • 250 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах. включено
  • Безкоштовний авто бекапМістить один слот резервного копіювання, який можна налаштувати на щоденний, щотижневий або щомісячний запуск.

AMD Ryzen VPS.R1

$16.99 Save  18 %
$13.99 Щомісячно
  • 1 виділений CPU AMD Ryzen 9 7950X з 4,5 GHz або подібний, на архітектурі Zen 4. vCPU
  • 4 GB DDR5ПАМ'ЯТЬ
  • 50 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6 включено Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах.
  • Авто бекап включено

AMD Ryzen VPS.R2

$29.99 Save  17 %
$24.99 Щомісячно
  • 2 виділених CPU AMD Ryzen 9 7950X з 4,5 GHz або подібний, на архітектурі Zen 4. vCPU
  • 8 GB DDR5ПАМ'ЯТЬ
  • 100 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6 включено Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах.
  • Авто бекап включено

AMD Ryzen VPS.R4

$109.99 Save  18 %
$89.99 Щомісячно
  • 8 виділених CPU AMD Ryzen 9 7950X з 4,5 GHz або подібний, на архітектурі Zen 4. vCPU
  • 32 GB DDR5ПАМ'ЯТЬ
  • 400 GB NVMeСХОВИЩЕ
  • Безлімітний трафік
  • IPv4 & IPv6 включено Підтримка IPv6 наразі недоступна у Франції, Фінляндії чи Нідерландах.
  • Авто бекап включено

*VAT excluded.

INCLUDED WITH EVERY PLAN

✓ No setup fees ✓1 Gbps network
✓ Full root access on KVM ✓ Free server monitoring ✓ Firewall management ✓24/7 support

Conda install vs pip install inside an environment

Both work inside an activated env, and pip there is safe (it installs into the env and nowhere else). Which one to reach for: conda for anything with compiled dependencies, so conda install numpy and friends, because conda ships prebuilt binaries and resolves the C libraries, BLAS or CUDA pieces along with the Python part. pip for small pure-Python libraries and for anything that never made it onto a conda channel.

The ordering deserves more attention than the choice itself. Install conda packages first and let pip fill gaps afterwards, since conda's solver knows nothing about what pip already placed in the env and can clobber it during a later install. Most quietly broken environments I've been asked to look at got that order backwards.

List environments and find where they live

conda env list

That prints every environment with its path, an asterisk marking the active one. By default they all sit under ~/miniconda3/envs/, one self-contained folder per env with its own interpreter and packages. Self-contained also means disk-hungry, and a heavy data-science env passes a few gigabytes without trying, so a du -sh ~/miniconda3/envs/* now and then is worth it, followed by culling the experiments you abandoned in March.

Every big idea starts small

Start on a small VPS and add resources from the panel as your project grows, keeping the same IP and setup and paying only the difference.

Export an environment.yml file

Conda offers two exports that serve different jobs:

conda env export > environment.yml
conda env export --from-history > environment.yml

The first records everything in the env, every transitive dependency pinned to exact versions and build strings. The second records only what you explicitly asked for. For anything shared or committed I'm firmly in the --from-history camp: the full export ties itself to one platform (its build strings won't resolve on a colleague's Mac) and fossilizes dependencies you never chose, where the history variant states your intent and lets the solver work it out on the target machine. The full export still has a job, rebuilding an identical env on the same machine, before a risky upgrade for instance. Both forms, plus flags you'll rarely touch, are in the conda environments documentation.

Recreate an environment from environment.yml

conda env create -f environment.yml

The environment's name comes from the name: field inside the file, and -n othername overrides it when that name is taken. Export plus recreate is how a project moves between machines, and it's also the honest repair path: an env broken badly enough gets deleted and rebuilt from its file, two commands and usually under a minute.

Remove an environment

Deactivate first if you're inside it, then:

conda env remove -n myproject

The whole folder under envs/ goes, with no confirmation prompt and no undo. That sounds harsher than it is in practice, since an exported yml file rebuilds anything you deleted prematurely.

Keep the base environment clean

Install nothing into base except conda itself. This is the opinionated part of the guide, and the reasoning is that base is where conda lives, so a dependency conflict there can break the very tool you'd use to fix it. Base is also where conda updates happen (the guide on how to update Miniconda covers that side), and the less it carries, the less an update can snag on. Whenever the temptation appears to pip install something into base, that's the cue to spend the thirty seconds creating a proper env for it instead.

Defaults vs conda-forge channels

Where packages come from matters more than most tutorials let on. A stock Miniconda install pulls from Anaconda's defaults channels, which are commercially licensed for organizations over 200 employees, while conda-forge is the community channel, free for everyone and usually fresher. You can reach for it per install with -c conda-forge, or make it the default via ~/.condarc. The full trade-off, including the installer that skips defaults entirely, is in the Miniconda vs Miniforge comparison.

For a worked example of this whole lifecycle with real stakes attached, the guide to install PyTorch in a Miniconda environment runs the same sequence against a GPU stack, old broken advice included.

Questions?

Can I create an environment outside ~/miniconda3/envs?

Yes: conda create --prefix ./envs/myproject python=3.12 puts the env at a path you choose, often inside the project folder itself. The trade is that conda can no longer address it by name, so activation takes the full path (conda activate ./envs/myproject) and conda env list shows it without a name column. Prefix envs suit projects living on a separate data disk; named envs suit everything else.

About the author

Alice Langley

I got my first writing work through open-source projects. Before anybody paid me, I was the person rewriting installation notes, answering the same question in Discord for the 25th time and fixing READMEs because the instructions were driving me mad. I was studying then and honestly didn't know technical writing was a job.

But now it's MY job: mostly tutorials, occasionally docs, KBs, sometimes editing. I work freelance. The non-computer part of my life is fairly crowded. I make cosplay costumes and props (sewing is the bit I'm best at, wigs are a different story for now), watch a lot of horror films and have recently started learning bookbinding from somebody who is much more patient than I am.

Deploy your next project in seconds

Bring your winning ideas online faster, with modern hardware and unmetered bandwidth. Join a European cloud trusted by thousands of developers and businesses worldwide.