-
Notifications
You must be signed in to change notification settings - Fork 1
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
Can't find envs, please help me #1
Comments
Could you turn on the trace level logging for By the look of it, Btw the script is tested on Linux only, so I may not be of much help if you are using MacOS. |
Thanks! I run VScode in Arch Linux. And I reproduce this problem below.
|
So this might be the log entry that points to the problem:
I was tripped by this line as well, and in my case it turned out that vscode-python was executing the script with |
Thanks again. > head /home/wxz/Program/micromamba/conda.sh
#!/bin/bash
# Adapted from micromamba/etc/profile.d/micromamba.sh
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
__mamba_exe() (
"$MAMBA_EXE" "${@}" I have tried many times, but nothing has changed.
I also can't understand why the vscode-python said
Finally, I found somthing by a simple test.
# replace some keys to conda info --json spec
# .. so that VSCode can recognize them
local _info=$(__mamba_exe "${@}" \
| sed 's/envs directories/envs_dirs/' \
| sed 's/package cache/pkgs_dirs/' \
| sed 's/base environment/root_prefix/' \
|| \exit)
echo "info" >> /home/wxz/log.txt
echo $_info >> /home/wxz/log.txt
local _envs=$(__mamba_exe env list --json)
echo "env" >> /home/wxz/log.txt
local _combined=$(jq -s '.[0] * .[1]' <(echo $_info) <(echo $_envs))
> cat log.txt
info
env
> cat log.txt
info
env
info
{ "root_prefix": "/home/wxz/Program/micromamba", "channels": null, "curl version": "libcurl/8.6.0 OpenSSL/3.2.1 zlib/1.2.13 zstd/1.5.5 libssh2/1.11.0 nghttp2/1.58.0", "env location": "/home/wxz/Program/micromamba/envs/seismic", "environment": "seismic (active)", "envs_dirs": [ "/home/wxz/Program/micromamba/envs" ], "libarchive version": "libarchive 3.7.2 zlib/1.2.13 bz2lib/1.0.8 libzstd/1.5.5", "libmamba version": "1.5.8", "micromamba version": "1.5.8", "pkgs_dirs": [ "/home/wxz/Program/micromamba/pkgs", "/home/wxz/.mamba/pkgs" ], "platform": "linux-64", "populated config files": null, "user config files": [ "/home/wxz/.mambarc" ], "virtual packages": [ "__unix=0=0", "__linux=6.8.4=0", "__glibc=2.39=0", "__archspec=1=x86_64-v3" ] }
env
{ "envs": [ "/home/wxz/Program/micromamba", "/home/wxz/Program/micromamba/envs/pre", "/home/wxz/Program/micromamba/envs/rec", "/home/wxz/Program/micromamba/envs/seism", "/home/wxz/Program/micromamba/envs/seismic" ] } I will try to debug it. Do you have other ideals? |
The crack is due to the environment variables. |
Glad that you have identified the root cause! IMHO hard code paths is perfectly fine in this case as the whole thing is a hack anyway. On the other hand, the fact that vscode-python on my machine successfully finds |
Yes, you are right. When the VScode is launched in terminal, it does inherit vars from terminal. |
Thanks for you scripts! I found your comment and try to use it. microsoft/vscode-python#20919 (comment)
I'm sure the hacked
conda.sh
changed the json but vscode-python still can't find the venv created by micromamba. Any suggestions?It seems that vscode-python need
/path/to/env/bin/conda info --json
.The text was updated successfully, but these errors were encountered: