Skip to content

Conda-unpack does not fix prefix #386

@Sieboldianus

Description

@Sieboldianus

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

I have successfully exported my conda envs about a year ago on our University's HPC using conda-pack (following the docs).

Now I want to restore the envs.

Restore environment:

conda --version
> conda 4.12.0
cd /data/horse/ws/s7777-p_lv_mobicart_2425
mkdir -p intro_env
tar -xzf ~/2024-01-16_Environments_archive_conda-pack/intro_env.tar.gz -C intro_env

Test:

./intro_env/bin/python
./intro_env/bin/python --version
> Python 3.10.13
source intro_env/bin/activate
conda-unpack
pip list
> -bash: /data/horse/ws/s7777-p_lv_mobicart_2425/intro_env/bin/pip: 
>     /data/horse/ws/s7777-p_lv_mobicart_2324/workshop_envs/intro_env3/bin/python3.10: 
>         bad interpreter: No such file or directory

This is the old prefix from a year ago:

/data/horse/ws/s7777-p_lv_mobicart_2324/workshop_envs/intro_env3/

This is the new prefix (folder):

/data/horse/ws/s7777-p_lv_mobicart_2425/intro_env/
conda-unpack --version
>conda-unpack 0.7.1

Additional Context

I could fix the issue by installing conda-prefix-replacement:

conda install -c conda-forge conda-prefix-replacement
cpr rehome /data/horse/ws/s7777-p_lv_mobicart_2425/intro_env \
    --old-prefix /data/horse/ws/s7777-p_lv_mobicart_2324/workshop_envs/intro_env3
pip list
> Package                  Version
> ------------------------ ------------
> adjustText               0.7.3
> affine                   2.4.0
> asttokens                2.4.1
> ...

But I thought this was what conda-unpack was for?

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale[bot] marked as stale due to inactivitystale::closed[bot] closed after being marked as staletype::bugdescribes erroneous operation, use severity::* to classify the type

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions