Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When I copy a conda env with copy -r old_env_dir new_env_dir, they are not independent #409

Open
chansonzhang opened this issue Oct 16, 2024 · 2 comments
Labels
TRIAGE Uncategorized issue

Comments

@chansonzhang
Copy link

chansonzhang commented Oct 16, 2024

cp -r old_env new_env
conda activate old_env
pip install transformers==4.38.1
conda activate new_env
pip install transformers==4.45.2
conda activate old_env
pip list|grep transformer
here I expect transformers in old_env is still 4.38.1, but it appears to influenced by the installation in new_env and got version 4.45.2

@chansonzhang
Copy link
Author

conda version is 24.5.0

@jbednar
Copy link
Collaborator

jbednar commented Oct 30, 2024

I'm not an expert on the conda internals, but as I understand it, conda has to hard-code the path to the environment within various files that are in that environment. So environments are not relocatable once installed. So whenever you use an environment, you need to make sure it's in the same location on the filesystem as when it was created. I.e., if you do want to make copies and move things around, fine, but then just make sure that the environment is back in its original location before you install or use anything on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TRIAGE Uncategorized issue
Projects
None yet
Development

No branches or pull requests

2 participants