Search code examples
pythonpipconda

If I move a repo that's pip-installed into a conda environment, will the environment still work?


I have a git repo (repo1) that I installed into my conda environment (env1) as follows:

conda activate env1
cd /path/to/repo1
pip install -e .

If I move repo1 to a different location, /new/path/to/repo1, will repo1 still be installed and working in env1? (And will the install still update when I update the repo, as the -e flag had ensured?)

If not, do I need to reinstall repo1, or can I change the path that conda's looking up somewhere?


Solution

  • pip install -e . Installs a python package using symlinks with absolute paths so yes if you move the directory you need to reinstall the package for it to work properly.

    Edit: To answer your question a bit more directly, i do not think you can move the directory as paths are usually absolute inside virtual environment, you would have to edit all generated info files, scripts and symlink files to point to the new location manually, which is probably doable but a pain.