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

"conda activate" behavior changed after conda 4.5 #9185

Closed
qingpeng opened this issue Apr 17, 2018 · 8 comments
Closed

"conda activate" behavior changed after conda 4.5 #9185

qingpeng opened this issue Apr 17, 2018 · 8 comments
Assignees
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity

Comments

@qingpeng
Copy link

I got the notification as below, which is something new to conda 4.5. But this has not been reflected in the documentation.

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If your shell is Bash or a Bourne variant, enable conda for the current user with

$ echo ". /global/homes/q/qingpeng/anaconda3/etc/profile.d/conda.sh" >> ~/.bashrc

or, for all users, enable conda with

$ sudo ln -s /global/homes/q/qingpeng/anaconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh

The options above will permanently enable the 'conda' command, but they do NOT
put conda's base (root) environment on PATH. To do so, run

$ conda activate

in your terminal, or to put the base environment on PATH permanently, run

$ echo "conda activate" >> ~/.bashrc

Previous to conda 4.4, the recommended way to activate conda was to modify PATH in
your ~/.bashrc file. You should manually remove the line that looks like

export PATH="/global/homes/q/qingpeng/anaconda3/bin:$PATH"

^^^ The above line should NO LONGER be in your ~/.bashrc file! ^^^

@abalter
Copy link

abalter commented Aug 6, 2018

Took me a while to find something official in the changelogs. Here it is:

https://github.com/conda/conda/blob/master/CHANGELOG.md#440-2017-12-20

This is a MAJOR change and not well publicized.

@voigtd
Copy link

voigtd commented Aug 25, 2018

@abalter Great find. The changelog explains the problem well.

@themichaelyang
Copy link

I couldn't find references to the conda activate commands either. It seems like most of the docs reference the older source activate <ENV>.

@jamesmyatt
Copy link
Contributor

I think one of the biggest issues is that the installation instructions still suggest modifying PATH.

e.g. https://github.com/conda/conda-docs/blob/master/docs/source/user-guide/install/macos.rst#installing-in-silent-mode

@axgkl
Copy link

axgkl commented Apr 2, 2019

Don't want to post yet a new issue but the installer output is also still wrong, April 2019 meanwhile...:

installing: conda-4.5.12-py37_0 ...
installation finished.
Do you wish the installer to initialize Miniconda3
in your /data/root/.bashrc ? [yes|no]
[no] >>> no

You may wish to edit your /data/root/.bashrc to setup Miniconda3:

source /data/root/miniconda3/etc/profile.d/conda.sh

Thank you for installing Miniconda3!
[root@axc2_master ~]# source /data/root/miniconda3/etc/profile.d/conda.sh
[root@axc2_master ~]# which python
/usr/bin/python
[root@axc2_master ~]# WTF!?

@kellymarchisio
Copy link

kellymarchisio commented Jun 12, 2019

@axgkl conda.sh should be run, not sourced. Try:
. /data/root/miniconda3/etc/profile.d/conda.sh
conda activate yourenvname
Then which python should return the correct thing. You'll know you've activated the environment if your env name appears in parenthesis before [root@axc2_master ~]
In the future, put . /data/root/miniconda3/etc/profile.d/conda.sh in your ~/.bashrc (assuming linux) so this'll run on startup.

@rrigdon rrigdon transferred this issue from conda/conda-docs Sep 3, 2019
@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue in the latest version of Conda

  2. Comment that the issue is still reproducible and include:

  • What version of Conda you reproduced the issue on
  • What OS and version you reproduced the issue on
  • What steps you followed to reproduce the issue
  1. It would also be helpful to have the output of the following commands available:
  • conda info
  • conda config --show-sources
  • conda list --show-channel-urls

NOTE: If this issue was closed prematurely, please leave a comment and we will gladly reopen the issue.

In case this issue was originally about a project that is covered by the Anaconda issue tracker (e.g. Anaconda, Miniconda, packages built by Anaconda, Inc. like Anaconda Navigator etc), please reopen the issue there again.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Nov 21, 2021
@github-actions
Copy link

Hi again!

This issue has been closed since it has not had recent activity.
Please don't hesitate to leave a comment if that was done prematurely.

Thank you for your contribution.

@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Feb 19, 2022
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Feb 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity
Projects
None yet
Development

No branches or pull requests

8 participants