Reputation: 1108
Using conda
to copy a Python environment.
I created a text file like this ....
conda list --explicit > *****.txt
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: win-64
@EXPLICIT
https://repo.anaconda.com/pkgs/main/win-64/blas-1.0-mkl.conda
https://repo.anaconda.com/pkgs/main/win-64/ca-certificates-2022.2.1-haa95532_0.conda
https://repo.anaconda.com/pkgs/main/win-64/icc_rt-2019.0.0-h0cc432a_1.conda
...
The executed this to replicate the environment.
(base) C:\Users\*******>conda create --name ENVNAME --file "D:\******\******.txt"
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- / / r e p o . a n a c o n d a . c o m / p k g s / m a i n / n o a r c h / b a c k c a l l - 0 . 2 . 0 - p y h d 3 e b 1 b 0 _ 0 . t a r . b z 2
- / / r e p o . a n a c o n d a . c o m / p k g s / m a i n / n o a r c h / a s y n c _ g e n e r a t o r - 1 . 1 0 - p y h d 3 e b 1 b 0 _ 0 . t a r . b z 2
- / / r e p o . a n a c o n d a . c o m / p k g s / m a i n / w i n - 6 4 / n u m e x p r - 2 . 8 . 1 - p y 3 8 h b 8 0 d 3 c a _ 0 . c o n d a
...
As you can see the error message contains all the repository paths with single spaces after every letter.
Does anyone has any idea about how this is happened and how to fix this?
Thank you!
Upvotes: 0
Views: 170
Reputation: 1108
Turned out the text encoding of the text file was in UFT-16LE. I fixed it and save it as UTF-8 and the following command just worked fine. I was also able to specify Python version at the same time.
conda create --name pycontrol --file "D:\****\****txt" python=3.8
Upvotes: 3