mamba-org / vscode-micromamba

A VSCode extension to generate development environments using micromamba and conda-forge package repository
BSD 3-Clause "New" or "Revised" License
82 stars 10 forks source link

Activate the micromamba by path error #48

Closed liuxiawei closed 4 months ago

liuxiawei commented 5 months ago

Environment

  1. node -v: v10.24.0
  2. npm -v: not installed
  3. Operating system: deepin (like debian )

Prerequisite

Installed micromamba by path /home/username/micromamba and use the base env Try to activate the micromamba by path ( /home/username/micromamba )

Steps to Reproduce

Try to activate the micromamba by path ( /home/username/micromamba )

Relevant Debug Info

It's ok by path /home/username/micromamba/envs/env1. but it is wrong with /home/username/micromamba
图片

Expected Behavior

Activate the micromamba env base by activate the micromamba by path ( /home/username/micromamba )

Activate the micromamba env env1 by activate the micromamba by path ( /home/username/micromamba/envs/env1 )

Actual Behavior

Activate the micromamba env base by activate the micromamba by path ( /home/username/micromamba ) 图片

But Activate the micromamba env env1 by activate the micromamba by path ( /home/username/micromamba/envs/env1 ) is ok

corker commented 5 months ago

Can I ask you to provide output from micromamba after the error you receive?

image

liuxiawei commented 5 months ago

Thank for your response. But I'm sad that there is no output in output windows or other windows. Only error report like screenshot. Should I turn it into what like debug version?

corker commented 5 months ago

It's strange that the micromamba output window is empty. Can you confirm that you see the output for the successful scenario?

liuxiawei commented 5 months ago

It is OK when create new env or change to the global env 图片 图片 And there is no output if I activate env by path or self update. And when activate env by path successfull, A info windows about "reload would appear" 图片

corker commented 5 months ago

I see, I'd need to add more logging for activate env by path use case to see what's going on. I'll make a new version when I have time. Would you be able to rerun it for me to get some logs?

liuxiawei commented 5 months ago

Of cause. It's my honor to help this project

corker commented 5 months ago

@liuxiawei please try the latest version v0.1.21 and post the output.

liuxiawei commented 5 months ago

I got error report:

Error: Command failed: . "/home/liuxiawei/micromamba/envs/st/etc/conda/deactivate.d/libxml2_deactivate.sh"
PS1='(base) '
export PATH='/home/liuxiawei/micromamba/bin:/home/liuxiawei/.vscode-micromamba:/home/liuxiawei/micromamba/condabin:/home/liuxiawei/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/home/liuxiawei/.fzf/bin'
export CONDA_PREFIX='/home/liuxiawei/micromamba'
export CONDA_SHLVL='2'
export CONDA_DEFAULT_ENV='base'
export CONDA_PROMPT_MODIFIER='(base) '
export CONDA_PREFIX_1='/home/liuxiawei/micromamba/envs/st'
. "/home/liuxiawei/micromamba/etc/conda/activate.d/activate-binutils_linux-64.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/activate-gcc_linux-64.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/activate-gfortran_linux-64.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/activate-gxx_linux-64.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/activate-r-base.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/libglib_activate.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/libxml2_activate.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/openjdk_activate.sh"

env
/bin/sh: 5: /home/liuxiawei/micromamba/etc/conda/activate.d/activate-binutils_linux-64.sh: Syntax error: "(" unexpected

Stack: Error: Command failed: . "/home/liuxiawei/micromamba/envs/st/etc/conda/deactivate.d/libxml2_deactivate.sh"
PS1='(base) '
export PATH='/home/liuxiawei/micromamba/bin:/home/liuxiawei/.vscode-micromamba:/home/liuxiawei/micromamba/condabin:/home/liuxiawei/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/home/liuxiawei/.fzf/bin'
export CONDA_PREFIX='/home/liuxiawei/micromamba'
export CONDA_SHLVL='2'
export CONDA_DEFAULT_ENV='base'
export CONDA_PROMPT_MODIFIER='(base) '
export CONDA_PREFIX_1='/home/liuxiawei/micromamba/envs/st'
. "/home/liuxiawei/micromamba/etc/conda/activate.d/activate-binutils_linux-64.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/activate-gcc_linux-64.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/activate-gfortran_linux-64.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/activate-gxx_linux-64.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/activate-r-base.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/libglib_activate.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/libxml2_activate.sh"
. "/home/liuxiawei/micromamba/etc/conda/activate.d/openjdk_activate.sh"

env
/bin/sh: 5: /home/liuxiawei/micromamba/etc/conda/activate.d/activate-binutils_linux-64.sh: Syntax error: "(" unexpected

    at checkExecSyncError (node:child_process:928:11)
    at execSync (node:child_process:1000:15)
    at node:electron/js2c/node_init:2:13035
    at SX (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:157:21)
    at $ne (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:227:77474)
    at /home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:227:77994
    at b (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:64269)
    at p (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:64200)
    at u._next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:11844)
    at e.next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:6483)
    at /home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:63794
    at u._next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:11844)
    at e.next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:6483)
    at /home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:18365
    at Object.pL [as errorContext] (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:5338)
    at e.next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:18148)
    at e.next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:23139)
    at Object.next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:110330)
    at r.next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:7331)
    at e._next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:6899)
    at e.next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:6483)
    at /home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:91577
    at u._next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:11844)
    at e.next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:6483)
    at /home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:64347
    at u._next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:11844)
    at e.next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:6483)
    at /home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:18365
    at Object.pL [as errorContext] (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:5338)
    at e.next (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:3:18148)
    at Object.set (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:227:75704)
    at TN (/home/liuxiawei/.vscode/extensions/corker.vscode-micromamba-0.1.21/out/extension.js:227:72248)

and The /home/liuxiawei/micromamba/etc/conda/activate.d/activate-binutils_linux-64.sh is attached, and I never modified this file. activate-binutils_linux-64.zip I tried to run it: 图片 图片

Maybe it caused by ZSH or use sh?

corker commented 5 months ago

Thank you for the logs @liuxiawei I found this issue in the conda repo. It seems like similar to this one https://github.com/conda/conda/issues/9959

liuxiawei commented 5 months ago

Thanks ! It's my own PC problem. In my PC, the /bin/sh is link to dash and The /usr/bin/sh link to /usr/bin/bash. I change the dash to bash and the vscode-micromamba is work right. This maybe the Deepin's problem. Thanks for your help.

liuxiawei commented 3 months ago

Hey dear. I recently changed my system and I faced this problem again. The script /path/micromamba/etc/conda/activate.d/activate-binutils_linux-64.sh is default used bash but in vscode-micromamba is used /bin/sh,which is link of dash (Now I'm Debian 12). Even the bash is compatible with dash. But I recommend to more clear of bash or dash. https://askubuntu.com/questions/141928/what-is-the-difference-between-bin-sh-and-bin-bash

allumik commented 2 months ago

I had the same problem when I logged in through the code tunnel from a different machine (win11->mac) into the same project. I got it to work by reloading the window, activating the global home directory first, reloading via the prompt and then reactivating the micromamba environment by path again. I haven't had time to debug this further, although I also did not get any output in the console. At first glance there seems to be a problem with vscode micromamba extension settings when switching computers?