cannot use environment.yaml to install conda env
Hello, I got the following message when installing conda with environment.yaml:
Pip subprocess error: ERROR: Ignored the following versions that require a different python version: 1.6.2 Requires-Python >=3.7,<3.10; 1.6.3 Requires-Python >=3.7,<3.10; 1.7.0 Requires-Python >=3.7,<3.10; 1.7.1 Requires-Python >=3.7,<3.10 ERROR: Could not find a version that satisfies the requirement torch==1.13.1+cu116 (from versions: 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) ERROR: No matching distribution found for torch==1.13.1+cu116
failed
CondaEnvException: Pip failed
Try adding --extra-index-url https://download.pytorch.org/whl/cu116 to your environment.yml file like this:
...
- zstandard=0.19.0=py310h5eee18b_0
- pip:
- --extra-index-url https://download.pytorch.org/whl/cu116
- absl-py==1.2.0
...
You can run conda env update --file environment.yml to re-download the dependencies in a conda environment you've already created.
I had the exact same issue, and this seemed to fix it for me. I'm basing what I did off of these two webpages:
- https://discuss.pytorch.org/t/no-matching-distribution-found-for-torch-1-13-1-cu117/174577/8
- https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#updating-an-environment
Try adding
--extra-index-url https://download.pytorch.org/whl/cu116to your environment.yml file like this:... - zstandard=0.19.0=py310h5eee18b_0 - pip: - --extra-index-url https://download.pytorch.org/whl/cu116 - absl-py==1.2.0 ...You can run
conda env update --file environment.ymlto re-download the dependencies in a conda environment you've already created.I had the exact same issue, and this seemed to fix it for me. I'm basing what I did off of these two webpages:
- https://discuss.pytorch.org/t/no-matching-distribution-found-for-torch-1-13-1-cu117/174577/8
- https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#updating-an-environment
Thanks Peter for you solution of solving the conda environment. Did you run the command pip install -r requirements.txt and do we need to run it? Thanks.