# Activate conda environment and run the conda program within Julia script

**URL:** <https://discourse.julialang.org/t/activate-conda-environment-and-run-the-conda-program-within-julia-script/55604>\
**Category:** General Usage\
**Tags:** question\
**Created:** [February 19, 2021, 6:39am UTC](https://discourse.julialang.org/t/activate-conda-environment-and-run-the-conda-program-within-julia-script/55604 "2021-02-19T06:39:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![biofuture](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/biofuture/32/22124_2.png) [@biofuture](https://discourse.julialang.org/u/biofuture)\
**Post date:** [February 19, 2021, 6:39am UTC](https://discourse.julialang.org/t/activate-conda-environment-and-run-the-conda-program-within-julia-script/55604/1 "2021-02-19T06:39:55Z")

</div>

Hi, developers

I would like to invoke a conda environment within the Julia script and then run the program in the conda environment in Julia using run(pipeline()) to invoke them. It seems that it does not work.

Does anyone know how to achieve this aim in Julia?

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [December 20, 2022, 4:15pm UTC](https://discourse.julialang.org/t/activate-conda-environment-and-run-the-conda-program-within-julia-script/55604/2 "2022-12-20T16:15:01Z")

</div>

One solution I found is to use `conda run` :

```julia
run(`conda run -n my_env some_command`)

```

You have to activate the environment each time, so it’s not great if you have to run something several times, but it seems to work fine otherwise.

> **[Activating a Conda environment in your Dockerfile](https://pythonspeed.com/articles/activate-conda-dockerfile/)**
>
> Learn how to activate a Conda environment in your Dockerfile.

---

<div class="post-metadata">

**Author:** ![CrisCool](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@CrisCool](https://discourse.julialang.org/u/CrisCool)\
**Post date:** [August 29, 2023, 10:46pm UTC](https://discourse.julialang.org/t/activate-conda-environment-and-run-the-conda-program-within-julia-script/55604/3 "2023-08-29T22:46:29Z")

</div>

Thanks for the question and for the answer, it was exactly what I needed!
