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

Console Scripts invalid when created using Relative Paths #3652

Open
3 tasks done
amgcc opened this issue Dec 3, 2024 · 0 comments
Open
3 tasks done

Console Scripts invalid when created using Relative Paths #3652

amgcc opened this issue Dec 3, 2024 · 0 comments
Assignees
Labels
type::bug Something isn't working

Comments

@amgcc
Copy link

amgcc commented Dec 3, 2024

Troubleshooting docs

  • My problem is not solved in the Troubleshooting docs

Anaconda default channels

  • I do NOT use the Anaconda default channels (pkgs/* etc.)

How did you install Mamba?

Micromamba

Search tried in issue tracker

environment creation

Latest version of Mamba

  • My problem is not solved with the latest version

Tried in Conda?

I do not have this problem with Conda, just with Mamba

Describe your issue

I use lock files to generate conda environments with micromamba. There is a bug with micromamba where creating an environment with a relative path fails. The steps to generate this require creating an environment in a directory where the parent folder does not exist. Rerunning the environment creation is fixed on the second attempt.

micromamba create --file packages.txt -p new_folder/target_env --yes

Transaction

  Prefix: new_folder/target_env

...

❯ grep 'bin/python' new_folder/target_env/bin/* 
new_folder/target_env/bin/2to3:#!new_folder/target_env/bin/python3.11
new_folder/target_env/bin/2to3-3.11:#!new_folder/target_env/bin/python3.11
new_folder/target_env/bin/idle3:#!new_folder/target_env/bin/python3.11
...

micromamba create --file packages.txt -p new_folder/target_env --yes
Transaction

  Prefix: /home/user/new_folder/target_env


❯ grep 'bin/python' new_folder/target_env/bin/*                       
new_folder/target_env/bin/2to3:#!/home/user/repos/btd/new_folder/target_env/bin/python3.11
new_folder/target_env/bin/2to3-3.11:#!/home/user/repos/btd/new_folder/target_env/bin/python3.11
new_folder/target_env/bin/idle3:#!/home/user/repos/btd/new_folder/target_env/bin/python3.11
...

Note how the prefix value changes when the parent folder ~/new_folder exists. On the second run the shebang for the scripts uses an absolute path and without it, the scripts simply will not run properly.

########################################################################################

Steps to create packages.txt:

> cat deps.yml 
channels:
  - conda-forge
dependencies:
  - python=3.11
  - tabulate

micromamba env create --yes -f deps.yml -p envs/test_env
micromamba env export -p envs/test_env --explicit > packages.txt

mamba info / micromamba info

❯ micromamba info

       libmamba version : 2.0.4
     micromamba version : 2.0.4
           curl version : libcurl/8.10.1 OpenSSL/3.4.0 zlib/1.3.1 zstd/1.5.6 libssh2/1.11.1 nghttp2/1.64.0
     libarchive version : libarchive 3.7.4 zlib/1.2.13 bz2lib/1.0.8 libzstd/1.5.6
       envs directories : /home/user/micromamba/envs
          package cache : /home/user/micromamba/pkgs
                          /home/user/.mamba/pkgs
            environment : /home/user/repos/btd/envs/ac9c09cd72dcf14397d1887a051bd87618447280 (active)
           env location : /home/user/repos/btd/envs/ac9c09cd72dcf14397d1887a051bd87618447280
      user config files : /home/user/.mambarc
 populated config files : /home/user/.condarc
       virtual packages : __unix=0=0
                          __linux=5.14.0=0
                          __glibc=2.34=0
                          __archspec=1=x86_64_v4
               channels : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
       base environment : /home/user/micromamba
               platform : linux-64

Logs

No response

environment.yml

channels:
  - conda-forge
dependencies:
  - python=3.11
  - tabulate

~/.condarc

changeps1: false
channel_priority: strict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants