Closed Honghe closed 2 months ago
If using the absolute path of conda.exe, it works.
> proxychains.exe C:\Users\x\miniforge3\Scripts\conda.exe env
usage: conda-script.py env [-h] command ...
positional arguments:
command
config Configure a conda environment.
create Create an environment based on an environment definition file.
export Export a given environment
list An alias for `conda info --envs`. Lists all conda environments.
remove Remove an environment.
update Update the current environment based on environment file.
options:
-h, --help Show this help message and exit.
The conda
is a alias of a function from Conda.psm1
> Get-Command conda
CommandType Name Version Source
----------- ---- ------- ------
Alias conda -> Invoke-Conda 0.0 Conda
Conda.psm1
:
function Invoke-Conda() {
# Don't use any explicit args here, we'll use $args and tab completion
# so that we can capture everything, INCLUDING short options (e.g. -n).
if ($Args.Count -eq 0) {
# No args, just call the underlying conda executable.
& $Env:CONDA_EXE $Env:_CE_M $Env:_CE_CONDA;
}
else {
$Command = $Args[0];
if ($Args.Count -ge 2) {
$OtherArgs = $Args[1..($Args.Count - 1)];
} else {
$OtherArgs = @();
}
switch ($Command) {
"activate" {
Enter-CondaEnvironment @OtherArgs;
}
"deactivate" {
Exit-CondaEnvironment;
}
default {
# There may be a command we don't know want to handle
# differently in the shell wrapper, pass it through
# verbatim.
& $Env:CONDA_EXE $Env:_CE_M $Env:_CE_CONDA $Command @OtherArgs;
}
}
}
}
New-Alias conda Invoke-Conda -Force
It works fine in conda env, so it's the problem of Conda or Powershell.
(base) PS C:\Users\x> proxychains.exe conda
usage: conda-script.py [-h] [-v] [--no-plugins] [-V] COMMAND ...
conda is a tool for managing and deploying applications, environments and packages.
options:
-h, --help Show this help message and exit.
-v, --verbose Can be used multiple times. Once for detailed output, twice for INFO logging, thrice for DEBUG
logging, four times for TRACE logging.
--no-plugins Disable all plugins that are not built into conda.
-V, --version Show the conda version number and exit.
Please be aware that proxychains won't understand any shell (cmd, powershell, bash, *sh) syntax/aliases. It uses CreateProcessW
to spawn child process. If a command line won't run when you type it in "Run Dialog", then it won't work with proxychains either.
I am confused, where does this mistake come from?
Environment: