-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Miniconda3 environment created with --prefix
flag fails to auto activate in terminal
#8770
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
Comments
Hi @itzsimpl, thanks for filing this. I can't test it right now (i'm on windows 10) but we'll definitely look into it. |
@DavidKutu this isn't a ds issue. |
$ source activate .conda-env
bash: activate: No such file or directory I am confused here, which of these activation scripts do you see when you select a local one? Is it this one, or the one I am mentioning below? So when you open a new terminal, you should the following commands. I assume you're using conda version greater than 4.4 $ source <path_to_activate_script>
$ conda activate <environment> |
I am using conda 4.7.12 and Visual Studio Code Insiders version 1.41. The two commands that are being executed are those that you mention, but they work only for the global environment, not for a local one. More precisely, what happens with a local environment, created in $ source activate local
bash: activate: No such file or directory I am wandering why is it necessary to use a two stage activation (source, followed by conda activate), as the environment, global or local, can be activated simply by passing the environment name or local folder, i.e. $ conda activate base will activate the global base environment, and $ conda activate ./local will activate the local environment that is setup in subdirectory |
Here's a comment I found justifying the block of code sending two activation scripts,
I am not aware the purpose of $ source activate local
bash: activate: No such file or directory there. But I don't think the commands the extension sends should translate to this. The above command assumes you've Can you send the screenshot of what error message pops up when the extension sends the command below? $ source <path_to_activate_script>
$ conda activate <environment> Thanks for cooperating. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thanks for the info. While I try to reproduce this, can you also help me with the following:
|
I appologize, that may have been my mistake. I tried to assess how your two state process works; judging by the value of |
Note, however, that there as a difference to |
Please could you let us know what version of conda you have, |
I am using conda 4.7.12 and Visual Studio Code Insiders version 1.41. |
@karrtikr the following is related. @karthiknadig Added a PR that supported activating environments with Might be good to see whether it works for us. That PR was meant to support activating conda environments created without a name, instead support activating using paths. |
@itzsimpl please fill the issue template. We would more info such as the extension version. |
|
I've just had the same issue. I was unable activate any conda environment other than base due to I have solved the issue (for myself) by adding Is it possible to make the extension use
|
Hey @itzsimpl @cromulen @underchemist , |
@karrtikr @karthiknadig Personally I think we should remove this hack. I.e. we need to fix conda activation just as we have done with conda run. Besides the requirement is for users of Hence I believe the right solution is to deprecate the hack for new versions of conda. |
I tend to agree with @DonJayamanne, but I'd also upvote the idea mentioned by @karrtikr. From a user's standpoint, it would be good to have the flexibility to change the activation script, if necessary. A working default should however always be provided. |
--prefix
flag fails to auto activate in terminal
@itzsimpl as a dumb workaround for conda install/distributions without the
to a directory in your path and now when |
From condaActivationProvider.ts: public async getUnixCommands(condaEnv: string, condaFile: string): Promise<string[] | undefined> {
const condaDir = path.dirname(condaFile);
const activateFile = path.join(condaDir, 'activate');
return [`source ${activateFile.fileToCommandArgument()} ${condaEnv.toCommandArgument()}`]; Wouldn't changing the return statement here from |
With newer versions of conda, the activating command I added |
@simozacca Opened #15818 to fix that now. #14123 (comment) is a workaround to fix activation with |
This is now fixed. |
I have a Debian system with miniconda3 installed and two environments: a global one
('base': conda)
and a local one('.conda-env': conda)
. When selecting the global one and creating a new terminal window the environment is correctly activated via the following commands:$ source /opt/miniconda3/bin/activate (miniconda3) $ conda activate base (miniconda3) $
Whereas if I select the local one, the activation does not take place:
$ source activate .conda-env bash: activate: No such file or directory
In reality in both cases it would be enough if the automatic call was:
instead of:
The text was updated successfully, but these errors were encountered: