# Installing an older torch version with pip from environment.yml

**URL:** <https://community.seqera.io/t/installing-an-older-torch-version-with-pip-from-environment-yml/2115>\
**Category:** Ask for help\
**Created:** [May 7, 2025, 11:31am UTC](https://community.seqera.io/t/installing-an-older-torch-version-with-pip-from-environment-yml/2115 "2025-05-07T11:31:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ReaKal](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/reakal/32/1794_2.png) [@ReaKal](https://community.seqera.io/u/ReaKal)\
**Post date:** [May 7, 2025, 11:31am UTC](https://community.seqera.io/t/installing-an-older-torch-version-with-pip-from-environment-yml/2115/1 "2025-05-07T11:31:32Z")

</div>

In my worklflow I use a local module named `predict` which needs `torch==1.5.0+cpu`, but the installation of torch with pip fails.

In the `/path/to/modules/local/predict/environment.yml` I find torch like this:

```auto
pip: 
- torch==1.5.0+cpu

```

In a test environment `my_env` (with python 3.8.10), the command without the `-f` argument raises an error:

```auto
(my_env)$pip install torch==1.5.0+cpu
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
ERROR: Could not find a version that satisfies the requirement torch==1.5.0+cpu (from versions: 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2, 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0, 2.4.1)
ERROR: No matching distribution found for torch==1.5.0+cpu

```

On the other hand, the command with the `-f` argument completes the installation.

```auto
(my_env)$pip install torch==1.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
...
Installing collected packages: numpy, future, torch
Successfully installed future-1.0.0 numpy-1.24.4 torch-1.5.0+cpu

```

How can I pass the argument `-f https://download.pytorch.org/whl/torch_stable.html` in `pip install` when installing an older version of torch from environment.yml?  
Thank you.

---

<div class="post-metadata">

**Author:** ![Adam\_Talbot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/adam_talbot/32/62_2.png) [@Adam\_Talbot](https://community.seqera.io/u/Adam_Talbot)\
**Post date:** [May 12, 2025, 9:14am UTC](https://community.seqera.io/t/installing-an-older-torch-version-with-pip-from-environment-yml/2115/2 "2025-05-12T09:14:54Z")

</div>

An educated guess here - pytorch 1.5 likely only supports certain Python versions. In your host env, you have the correct version but the version installed by Conda is likely to be one of the latest versions. Can you try specifying the specific version of Python in your conda env?

It might be easier to use conda to install pytorch rather than pip which has notoriously poor dependency management: [Pytorch | Anaconda.org](https://anaconda.org/pytorch/pytorch?version=1.5.1)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/system/32/2402_2.png) [@system](https://community.seqera.io/u/system)\
**Post date:** [May 19, 2025, 9:15am UTC](https://community.seqera.io/t/installing-an-older-torch-version-with-pip-from-environment-yml/2115/3 "2025-05-19T09:15:18Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
