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 source fish setup file #2611

Closed
RSully opened this Issue Jun 7, 2016 · 24 comments

Comments

Projects
None yet
@RSully

RSully commented Jun 7, 2016

I installed a clean miniconda3 distribution and updated to 4.0.8. I found this instruction to integrate with fish (as out of the box, it seems source activate does not work) but the .fish file does not exist. Are there other instructions I couldn't find to finish my installation?

@msarahan

This comment has been minimized.

Show comment
Hide comment
@msarahan

msarahan Jun 7, 2016

Contributor

The fish integration is only present in the pending 4.1 release. You can
download the relevant files and put them in place manually. Those files
are in https://github.com/conda/conda/tree/master/bin

On Tue, Jun 7, 2016 at 9:30 AM Ryan notifications@github.com wrote:

I installed a clean miniconda3 distribution and updated to 4.0.8. I found
this https://github.com/conda/conda/blob/4.0.8/bin/conda.fish#L14
instruction to integrate with fish (as out of the box, it seems source
activate does not work) but the .fish file does not exist. Are there
other instructions I couldn't find to finish my installation?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#2611, or mute the thread
https://github.com/notifications/unsubscribe/AACV-YiNu_3OVNE-QC21mU4IlSXa87Oyks5qJYCdgaJpZM4Iv_KX
.

Contributor

msarahan commented Jun 7, 2016

The fish integration is only present in the pending 4.1 release. You can
download the relevant files and put them in place manually. Those files
are in https://github.com/conda/conda/tree/master/bin

On Tue, Jun 7, 2016 at 9:30 AM Ryan notifications@github.com wrote:

I installed a clean miniconda3 distribution and updated to 4.0.8. I found
this https://github.com/conda/conda/blob/4.0.8/bin/conda.fish#L14
instruction to integrate with fish (as out of the box, it seems source
activate does not work) but the .fish file does not exist. Are there
other instructions I couldn't find to finish my installation?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#2611, or mute the thread
https://github.com/notifications/unsubscribe/AACV-YiNu_3OVNE-QC21mU4IlSXa87Oyks5qJYCdgaJpZM4Iv_KX
.

@RSully

This comment has been minimized.

Show comment
Hide comment
@RSully

RSully Jun 15, 2016

As I mentioned in #2680, I'm still not seeing the .fish file there in 4.1.0.

RSully commented Jun 15, 2016

As I mentioned in #2680, I'm still not seeing the .fish file there in 4.1.0.

@jaimergp

This comment has been minimized.

Show comment
Hide comment
@jaimergp

jaimergp Jun 15, 2016

Contributor

For the moment, I am using conda 4.0.8 just fine. You can grab the conda.fish file from the repo and copy it anywhere. Then, make sure to source it in your user config.fish file.

For example, I have mine in $ANACONDA_INSTALL/bin, and my config.fish (in ~/.config/fish) looks like this:

set -gx PATH ~/.local/anaconda/bin $PATH
source (conda info --root)/bin/conda.fish
Contributor

jaimergp commented Jun 15, 2016

For the moment, I am using conda 4.0.8 just fine. You can grab the conda.fish file from the repo and copy it anywhere. Then, make sure to source it in your user config.fish file.

For example, I have mine in $ANACONDA_INSTALL/bin, and my config.fish (in ~/.config/fish) looks like this:

set -gx PATH ~/.local/anaconda/bin $PATH
source (conda info --root)/bin/conda.fish
@RSully

This comment has been minimized.

Show comment
Hide comment
@RSully

RSully Jun 16, 2016

Still a problem on 4.1.1 even after #2694 (and #2680)

RSully commented Jun 16, 2016

Still a problem on 4.1.1 even after #2694 (and #2680)

@RSully

This comment has been minimized.

Show comment
Hide comment
@RSully

RSully Jun 20, 2016

Still a problem on 4.1.2

RSully commented Jun 20, 2016

Still a problem on 4.1.2

@RSully

This comment has been minimized.

Show comment
Hide comment
@RSully

RSully Jun 27, 2016

I was expecting 4.1 to be 'year of the fish', but 3 (4th pending) minor versions in and no dice. After @kalefranz's #2694 I thought the next release might include it. Is there anything I can do to make progress on this?

RSully commented Jun 27, 2016

I was expecting 4.1 to be 'year of the fish', but 3 (4th pending) minor versions in and no dice. After @kalefranz's #2694 I thought the next release might include it. Is there anything I can do to make progress on this?

@kalefranz

This comment has been minimized.

Show comment
Hide comment
@kalefranz

kalefranz Jun 27, 2016

Member

A PR that fixes it? :-p

Or more details. I actually thought we had gotten close to fixing this here: #2694

Member

kalefranz commented Jun 27, 2016

A PR that fixes it? :-p

Or more details. I actually thought we had gotten close to fixing this here: #2694

@kalefranz kalefranz added this to the 4.1 milestone Jun 27, 2016

@kalefranz kalefranz added the type-bug label Jun 27, 2016

@RSully

This comment has been minimized.

Show comment
Hide comment
@RSully

RSully Jun 27, 2016

Honestly I don't even know where I'd begin; I know nothing about the internals or release process. Looking at my 4.1.4 miniconda, it looks like maybe conda.recipe/build.sh is not even being executed? $PREFIX/exec/ does not exist either.

RSully commented Jun 27, 2016

Honestly I don't even know where I'd begin; I know nothing about the internals or release process. Looking at my 4.1.4 miniconda, it looks like maybe conda.recipe/build.sh is not even being executed? $PREFIX/exec/ does not exist either.

@kalefranz

This comment has been minimized.

Show comment
Hide comment
@kalefranz

kalefranz Jun 27, 2016

Member

You're right, it's not there. Communication problem between me and @ilanschnell.

@ilanschnell, I know we had an issue with the conda.recipe in this repo at one point, but can you add

# link to exec folder as a more contained proxy.  Idea is that people can add exec folder to PATH
#    instead of bin, and have only activate & conda on PATH - no trampling other stuff.
mkdir -p $PREFIX/exec
ln -s $PREFIX/bin/activate $PREFIX/exec/activate
ln -s $PREFIX/bin/conda $PREFIX/exec/conda

mkdir -p $PREFIX/etc/fish/conf.d/
cp $SRC_DIR/shell/conda.fish $PREFIX/etc/fish/conf.d/

to build.sh for your conda recipe?

The bld.bat probably needs some work too, but I'm not sure how much of what's in https://github.com/conda/conda/tree/master/conda.recipe we should pull.

Member

kalefranz commented Jun 27, 2016

You're right, it's not there. Communication problem between me and @ilanschnell.

@ilanschnell, I know we had an issue with the conda.recipe in this repo at one point, but can you add

# link to exec folder as a more contained proxy.  Idea is that people can add exec folder to PATH
#    instead of bin, and have only activate & conda on PATH - no trampling other stuff.
mkdir -p $PREFIX/exec
ln -s $PREFIX/bin/activate $PREFIX/exec/activate
ln -s $PREFIX/bin/conda $PREFIX/exec/conda

mkdir -p $PREFIX/etc/fish/conf.d/
cp $SRC_DIR/shell/conda.fish $PREFIX/etc/fish/conf.d/

to build.sh for your conda recipe?

The bld.bat probably needs some work too, but I'm not sure how much of what's in https://github.com/conda/conda/tree/master/conda.recipe we should pull.

@kalefranz

This comment has been minimized.

Show comment
Hide comment
@kalefranz

kalefranz Jun 30, 2016

Member

@RSully 4.1.5 was released today. And I've just verified that $CONDA_ROOT/etc/fish/conf.d/conda.fish exists for you.

Member

kalefranz commented Jun 30, 2016

@RSully 4.1.5 was released today. And I've just verified that $CONDA_ROOT/etc/fish/conf.d/conda.fish exists for you.

@kalefranz kalefranz closed this Jun 30, 2016

@msarahan msarahan referenced this issue Jun 30, 2016

Merged

Add conda #656

@RSully

This comment has been minimized.

Show comment
Hide comment
@RSully

RSully Jun 30, 2016

Thanks! Should add that to the changelog :).

RSully commented Jun 30, 2016

Thanks! Should add that to the changelog :).

@RSully

This comment has been minimized.

Show comment
Hide comment
@RSully

RSully Jul 6, 2016

@kalefranz This was fixed, and conda.fish is available in (conda info --root)/etc/fish/conf.d/ however conda.fish shows the wrong path as part of its install guide. Also, there is a UX problem since conda create says to use source activate when really the fish file defines activate and conda activate, no source.

RSully commented Jul 6, 2016

@kalefranz This was fixed, and conda.fish is available in (conda info --root)/etc/fish/conf.d/ however conda.fish shows the wrong path as part of its install guide. Also, there is a UX problem since conda create says to use source activate when really the fish file defines activate and conda activate, no source.

@soxofaan

This comment has been minimized.

Show comment
Hide comment
@soxofaan

soxofaan Mar 19, 2017

Contributor

I had a bit of the same struggle, but eventually found conda.fish as noted above (using conda 4.2.13 at the moment)
This line in my ~/.config/fish/config.fish works for me:

source (conda info --root)/etc/fish/conf.d/conda.fish
Contributor

soxofaan commented Mar 19, 2017

I had a bit of the same struggle, but eventually found conda.fish as noted above (using conda 4.2.13 at the moment)
This line in my ~/.config/fish/config.fish works for me:

source (conda info --root)/etc/fish/conf.d/conda.fish

kalefranz added a commit to kalefranz/conda that referenced this issue Mar 23, 2017

kalefranz added a commit that referenced this issue Mar 24, 2017

Merge pull request #4924 from kalefranz/pr-4896
Issue #2611: update documentation about how to source conda.fish
@alexbw

This comment has been minimized.

Show comment
Hide comment
@alexbw

alexbw Apr 10, 2017

Contributor

Getting the following error:

 ~/a/bin> source activate python27
'case' builtin not inside of switch block
activate (line 22): case "$(uname -s)" in
                    ^
from sourcing file activate
	called on standard input

source: Error while reading file 'activate'
Contributor

alexbw commented Apr 10, 2017

Getting the following error:

 ~/a/bin> source activate python27
'case' builtin not inside of switch block
activate (line 22): case "$(uname -s)" in
                    ^
from sourcing file activate
	called on standard input

source: Error while reading file 'activate'
@abhigenie92

This comment has been minimized.

Show comment
Hide comment
@abhigenie92

abhigenie92 Aug 14, 2017

Any ideas, it(#2611 (comment)) did work for me before but doesn't now for some reason.

$ source activate ppo
source: Error encountered while sourcing file 'activate':
source: No such file or directoryfish --version
$ fish --version
fish, version 2.6.0
 $  cat ./.config/fish/config.fish
set -gx PATH /anaconda/bin $PATH
set -x PYTHONPATH /Users/abhishek/Packages/rllab $PYTHONPATH
set -x MUJOCO_PY_MJKEY_PATH /Users/abhishek/.mujoco/mjkey.txt
set -x MUJOCO_PY_MJPRO_PATH /Users/abhishek/.mujoco/mjpro131
set -x HOMEBREW_NO_AUTO_UPDATE 1
set -x PATH $HOME/.cargo/bin $PATH
test -e {$HOME}/.iterm2_shell_integration.fish ; and source {$HOME}/.iterm2_shell_integration.fish


# useful functions
function take
    command mkdir $argv;and cd $argv
end
#


eval (python -m virtualfish)

if set -q VIRTUAL_ENV
    echo -n -s (set_color -b blue white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " "
end


# Show the conda environment, calculate __fish_prompt_conda only once
if set -q CONDA_DEFAULT_ENV
    if not set -q __fish_prompt_conda
        set -g __fish_prompt_conda (set_color --bold -b blue red)$CONDA_DEFAULT_ENV"$__fish_prompt_normal "
    end
    echo -n $__fish_prompt_conda
end

# to make conda activate/create work for virtual envs
source (conda info --root)/etc/fish/conf.d/conda.fish


alias envact='source /anaconda/bin/activate'

abhigenie92 commented Aug 14, 2017

Any ideas, it(#2611 (comment)) did work for me before but doesn't now for some reason.

$ source activate ppo
source: Error encountered while sourcing file 'activate':
source: No such file or directoryfish --version
$ fish --version
fish, version 2.6.0
 $  cat ./.config/fish/config.fish
set -gx PATH /anaconda/bin $PATH
set -x PYTHONPATH /Users/abhishek/Packages/rllab $PYTHONPATH
set -x MUJOCO_PY_MJKEY_PATH /Users/abhishek/.mujoco/mjkey.txt
set -x MUJOCO_PY_MJPRO_PATH /Users/abhishek/.mujoco/mjpro131
set -x HOMEBREW_NO_AUTO_UPDATE 1
set -x PATH $HOME/.cargo/bin $PATH
test -e {$HOME}/.iterm2_shell_integration.fish ; and source {$HOME}/.iterm2_shell_integration.fish


# useful functions
function take
    command mkdir $argv;and cd $argv
end
#


eval (python -m virtualfish)

if set -q VIRTUAL_ENV
    echo -n -s (set_color -b blue white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " "
end


# Show the conda environment, calculate __fish_prompt_conda only once
if set -q CONDA_DEFAULT_ENV
    if not set -q __fish_prompt_conda
        set -g __fish_prompt_conda (set_color --bold -b blue red)$CONDA_DEFAULT_ENV"$__fish_prompt_normal "
    end
    echo -n $__fish_prompt_conda
end

# to make conda activate/create work for virtual envs
source (conda info --root)/etc/fish/conf.d/conda.fish


alias envact='source /anaconda/bin/activate'
@RSully

This comment has been minimized.

Show comment
Hide comment
@RSully

RSully Aug 15, 2017

There's no source support in fish at all for conda. You want conda activate $env. Just tested on conda 4.3.24 and fish 2.6.0.

See:

# USAGE
#
# To activate an environment (via name or path), you can use one of the following:
#
# activate ENV
# conda activate ENV
#
# To deactivate an environment, use one of:
#
# deactivate
# conda deactivate

RSully commented Aug 15, 2017

There's no source support in fish at all for conda. You want conda activate $env. Just tested on conda 4.3.24 and fish 2.6.0.

See:

# USAGE
#
# To activate an environment (via name or path), you can use one of the following:
#
# activate ENV
# conda activate ENV
#
# To deactivate an environment, use one of:
#
# deactivate
# conda deactivate

@marcstreeter

This comment has been minimized.

Show comment
Hide comment
@marcstreeter

marcstreeter Oct 21, 2017

History of events.

  • installed conda
  • months passed
  • installed fish 2.6.0
  • updated conda to 4.3.27

then I added line in ~/.config/fish/config.fish

 source (conda info --root)/etc/fish/conf.d/conda.fish

and opened a new terminal session

Now instead of doing source activate $env I do conda activate $env.

marcstreeter commented Oct 21, 2017

History of events.

  • installed conda
  • months passed
  • installed fish 2.6.0
  • updated conda to 4.3.27

then I added line in ~/.config/fish/config.fish

 source (conda info --root)/etc/fish/conf.d/conda.fish

and opened a new terminal session

Now instead of doing source activate $env I do conda activate $env.

@Davidnet

This comment has been minimized.

Show comment
Hide comment
@Davidnet

Davidnet Oct 30, 2017

Any followup to this?

Davidnet commented Oct 30, 2017

Any followup to this?

@jaimergp

This comment has been minimized.

Show comment
Hide comment
@jaimergp

jaimergp Oct 30, 2017

Contributor

@Davidnet What problems are you facing? What @marcstreeter said is a perfect step-by-step guide on how to make it work.

Btw, all fish users here, since conda is in $PATH, so is Anaconda python. That allows us to change to a faster source mechanism that avoids those ~500ms when launching a new terminal:

Replace (conda info --root) by (python -c "import sys; print(sys.prefix)"). I'll make a PR to update the built-in docs.

Contributor

jaimergp commented Oct 30, 2017

@Davidnet What problems are you facing? What @marcstreeter said is a perfect step-by-step guide on how to make it work.

Btw, all fish users here, since conda is in $PATH, so is Anaconda python. That allows us to change to a faster source mechanism that avoids those ~500ms when launching a new terminal:

Replace (conda info --root) by (python -c "import sys; print(sys.prefix)"). I'll make a PR to update the built-in docs.

@RSully

This comment has been minimized.

Show comment
Hide comment
@RSully

RSully Oct 31, 2017

@jaimergp that may be problematic for those with other python installs that are higher in PATH (common name conflict, as opposed to conda being unique). I personally have another python install as my "default" and only activate conda as needed (sometimes even just as conda activate root)

RSully commented Oct 31, 2017

@jaimergp that may be problematic for those with other python installs that are higher in PATH (common name conflict, as opposed to conda being unique). I personally have another python install as my "default" and only activate conda as needed (sometimes even just as conda activate root)

@jaimergp

This comment has been minimized.

Show comment
Hide comment
@jaimergp

jaimergp Oct 31, 2017

Contributor

@jaimergp that may be problematic for those with other python installs that are higher in PATH (common name conflict, as opposed to conda being unique). I personally have another python install as my "default" and only activate conda as needed (sometimes even just as conda activate root)

Fair enough, I hadn't considered that use case. Is there any possibility to have conda installer hardcode the path directly?

Contributor

jaimergp commented Oct 31, 2017

@jaimergp that may be problematic for those with other python installs that are higher in PATH (common name conflict, as opposed to conda being unique). I personally have another python install as my "default" and only activate conda as needed (sometimes even just as conda activate root)

Fair enough, I hadn't considered that use case. Is there any possibility to have conda installer hardcode the path directly?

@endolith

This comment has been minimized.

Show comment
Hide comment
@endolith

endolith Aug 26, 2018

@marcstreeter

then I added line in ~/.config/fish/config.fish

source (conda info --root)/etc/fish/conf.d/conda.fish

But:

~/.config/fish/config.fish (line 1): 
conda info --root
^
in command substitution
	called on line -1 of file ~/.config/fish/config.fish

from sourcing file ~/.config/fish/config.fish
	called during startup

Like, you have to add this command to make conda available... but this command depends on conda, which isn't available until after you run this command? 😕

If I instead add the line source ~/anaconda3/etc/fish/conf.d/conda.fish, it seems to work.

endolith commented Aug 26, 2018

@marcstreeter

then I added line in ~/.config/fish/config.fish

source (conda info --root)/etc/fish/conf.d/conda.fish

But:

~/.config/fish/config.fish (line 1): 
conda info --root
^
in command substitution
	called on line -1 of file ~/.config/fish/config.fish

from sourcing file ~/.config/fish/config.fish
	called during startup

Like, you have to add this command to make conda available... but this command depends on conda, which isn't available until after you run this command? 😕

If I instead add the line source ~/anaconda3/etc/fish/conf.d/conda.fish, it seems to work.

@tkkcc

This comment has been minimized.

Show comment
Hide comment
@tkkcc

tkkcc Oct 12, 2018

I prefer just put conda.fish in functions without changing PATH or config.fish

ln -s /opt/anaconda/etc/fish/conf.d/conda.fish $HOME/.config/fish/functions/

when run conda activate ..., PATH will be modified automatically

tkkcc commented Oct 12, 2018

I prefer just put conda.fish in functions without changing PATH or config.fish

ln -s /opt/anaconda/etc/fish/conf.d/conda.fish $HOME/.config/fish/functions/

when run conda activate ..., PATH will be modified automatically

@henryiii

This comment has been minimized.

Show comment
Hide comment
@henryiii

henryiii Oct 17, 2018

Like, you have to add this command to make conda available... but this command depends on conda, which isn't available until after you run this command? 😕

You can temporarily add the anaconda bin directory to your path to do this. But if you know the bin directory, you also know the root directory of anaconda and can just use that directly. But @tkkcc's solution is much better, IMO.

henryiii commented Oct 17, 2018

Like, you have to add this command to make conda available... but this command depends on conda, which isn't available until after you run this command? 😕

You can temporarily add the anaconda bin directory to your path to do this. But if you know the bin directory, you also know the root directory of anaconda and can just use that directly. But @tkkcc's solution is much better, IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment