# Install python packages in virtual Conda environment

**URL:** <https://forum.access-hive.org.au/t/install-python-packages-in-virtual-conda-environment/3981>\
**Category:** Technical\
**Tags:** help\
**Created:** [10 December 2024 02:57 UTC](https://forum.access-hive.org.au/t/install-python-packages-in-virtual-conda-environment/3981 "2024-12-10T02:57:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chenhui.jin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/chenhui.jin/32/2550_2.png) [@chenhui.jin](https://forum.access-hive.org.au/u/chenhui.jin)\
**Post date:** [10 December 2024 02:57 UTC](https://forum.access-hive.org.au/t/install-python-packages-in-virtual-conda-environment/3981/1 "2024-12-10T02:57:32Z")

</div>

Hi all,

I’m trying to install two python packages ([CPyS](https://github.com/stella-bourdin/CPyS) and [tempest-extremes](https://github.com/ClimateGlobalChange/tempestextremes)) on (`/scratch/gb02/cj0591/`).

CPyS can be simply installed by pip, however, tempest-extremes needs to be installed by conda. In this case, I am struggling in create my own conda environment, and get these two package installed.

Regards,  
Chenhui

---

<div class="post-metadata">

**Author:** ![lachlanswhyborn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/lachlanswhyborn/32/1837_2.png) [@lachlanswhyborn](https://forum.access-hive.org.au/u/lachlanswhyborn)\
**Post date:** [10 December 2024 03:49 UTC](https://forum.access-hive.org.au/t/install-python-packages-in-virtual-conda-environment/3981/2 "2024-12-10T03:49:43Z")

</div>

Hi,

I’m assuming you are using Gadi? If yes, then you should be able to follow the guide from UNSW [here](http://climate-cms.wikis.unsw.edu.au/Conda#Creating_personal_environments). If you have problems, let me know.

---

<div class="post-metadata">

**Author:** ![chenhui.jin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/chenhui.jin/32/2550_2.png) [@chenhui.jin](https://forum.access-hive.org.au/u/chenhui.jin)\
**Post date:** [10 December 2024 23:19 UTC](https://forum.access-hive.org.au/t/install-python-packages-in-virtual-conda-environment/3981/3 "2024-12-10T23:19:07Z")

</div>

Hi @lachlanswhyborn,

Yes, I am using Gadi and thanks for sending the guide. I successfully created my own conda environment under /scratch/gb02/cj0591, and installed CPyS.

However, I failed to install tempest-extremes:

I tried  
`conda install -c conda-forge tempest-extremes`

 ![Screenshot 2024-12-10 at 16.54.47](https://us1.discourse-cdn.com/flex020/uploads/access1/original/2X/b/b5014750e10353f05bcd40309e106b208d1dfe3b.png)

---

<div class="post-metadata">

**Author:** ![lachlanswhyborn](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/lachlanswhyborn/32/1837_2.png) [@lachlanswhyborn](https://forum.access-hive.org.au/u/lachlanswhyborn)\
**Post date:** [11 December 2024 00:00 UTC](https://forum.access-hive.org.au/t/install-python-packages-in-virtual-conda-environment/3981/4 "2024-12-11T00:00:49Z")

</div>

Sorry, seems that the particular page I linked is a bit out of date- they have recently moved to Github blogs. [Here](https://coecms.github.io/posts/2024-06-05-mixing-python-envs.html) is their piece on custom python environments.

The gist of it is:

- Load the `hh5` conda environment via `module`
- Use a virtual environment by `python3 -m venv <env_name> --system-site-packages && source <env_name>/bin/activate`
- Install package via pip `pip install <package>`

Alternatively, you can skip the virtual environment creation and just call  
`pip install --user <package>`.

---

<div class="post-metadata">

**Author:** ![chenhui.jin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/chenhui.jin/32/2550_2.png) [@chenhui.jin](https://forum.access-hive.org.au/u/chenhui.jin)\
**Post date:** [11 December 2024 00:34 UTC](https://forum.access-hive.org.au/t/install-python-packages-in-virtual-conda-environment/3981/5 "2024-12-11T00:34:20Z")

</div>

I followed the instruction to create the environment (myenv2) and activate it and installed CPyS. However, I still couldn’t install tempest-ctremes (see errors below)

 ![Screenshot 2024-12-11 at 11.31.46](https://us1.discourse-cdn.com/flex020/uploads/access1/original/2X/b/bcd40e8f8f791f300d96735c47017f80accbb028.png)

---

<div class="post-metadata">

**Author:** ![Scott](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/scott/32/37_2.png) [@Scott](https://forum.access-hive.org.au/u/Scott)\
**Post date:** [11 December 2024 00:53 UTC](https://forum.access-hive.org.au/t/install-python-packages-in-virtual-conda-environment/3981/6 "2024-12-11T00:53:33Z")

</div>

`conda install` will install into the active environment, which is trying to install into the shared environment you don’t have write permissions to. Use `conda create` instead to create a new environment e.g. to create one named named `tempest`:

```auto
conda create -n tempest -c conda-forge tempest-extremes

```

You will then need to `conda activate` the environment to use it.

---

<div class="post-metadata">

**Author:** ![chenhui.jin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/chenhui.jin/32/2550_2.png) [@chenhui.jin](https://forum.access-hive.org.au/u/chenhui.jin)\
**Post date:** [11 December 2024 02:24 UTC](https://forum.access-hive.org.au/t/install-python-packages-in-virtual-conda-environment/3981/7 "2024-12-11T02:24:43Z")

</div>

Thanks! I installed it successfully.

---

<div class="post-metadata">

**Author:** ![anton](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/anton/32/1836_2.png) [@anton](https://forum.access-hive.org.au/u/anton)\
**Post date:** [14 January 2025 21:52 UTC](https://forum.access-hive.org.au/t/install-python-packages-in-virtual-conda-environment/3981/8 "2025-01-14T21:52:32Z")

</div>


