Using conda with Fish shell

27 views
Skip to first unread message

Advrk

unread,
Mar 27, 2016, 6:26:03 PM3/27/16
to conda - Public
Hello,

I successfully installed the latest Anaconda x64 in my Linux distribution running the Fish shell, and I am now going through the 30-mins. conda test drive.

However, during the first step with the "source activate" command I got the error:

source: Error encountered while sourcing file “activate”:
source: No such file or directory

If I run this command with bash it works fine, so is there a way to set up Fish and conda to work well together? If so, how? Thank you!!

Nathan Goldbaum

unread,
Mar 27, 2016, 8:12:21 PM3/27/16
to Advrk, conda - Public
There seems to be basic support for the fish shell shipped with conda:


It looks like it's not documented beyond the comments in this file.

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.

Ilan Schnell

unread,
Mar 27, 2016, 8:22:05 PM3/27/16
to Nathan Goldbaum, Advrk, conda - Public
There is indeed support for fish in the master branch of conda.  However, the master branch has not been release yet.  The latest version on conda (4.0.5) does not support fish.

Advrk Aplmrkt

unread,
Mar 28, 2016, 3:58:12 AM3/28/16
to Ilan Schnell, Nathan Goldbaum, conda - Public
I see, thank you both for your answers.

Is there a possible workaround with fish right now? Or would it be
easier if I just stuck with bash for now?

If so, what's the normal release schedule for things like this? I.e.
when might a new version of conda include this support? Thanks!

On 28/03/2016, Ilan Schnell <il...@continuum.io> wrote:
> There is indeed support for fish in the master branch of conda. However,
> the master branch has not been release yet. The latest version on conda
> (4.0.5) does not support fish.
>
> On Sun, Mar 27, 2016 at 7:12 PM, Nathan Goldbaum <natha...@gmail.com>
> wrote:
>
>> There seems to be basic support for the fish shell shipped with conda:
>>
>> https://github.com/conda/conda/blob/master/bin/conda.fish
>> <https://github.com/conda/conda/blob/5b97a96d78e65d8178eb60d36e0fc99cd5b3ab21/bin/conda.fish>
>>
>> It looks like it's not documented beyond the comments in this file.
>>
>> On Sun, Mar 27, 2016 at 5:26 PM, Advrk <avka...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I successfully installed the latest Anaconda x64 in my Linux
>>> distribution
>>> running the Fish shell <http://fishshell.com/>, and I am now going

Floris Bruynooghe

unread,
Apr 7, 2016, 7:53:31 PM4/7/16
to Advrk Aplmrkt, Ilan Schnell, Nathan Goldbaum, conda - Public
On 28 March 2016 at 08:58, Advrk Aplmrkt <avka...@gmail.com> wrote:
> I see, thank you both for your answers.
>
> Is there a possible workaround with fish right now? Or would it be
> easier if I just stuck with bash for now?

I use conda-workon with fish which works just fine (disclaimer, I'm
the author). You can find it on pypi.

Regard,
Floris

Advrk Aplmrkt

unread,
Apr 8, 2016, 5:57:11 AM4/8/16
to Floris Bruynooghe, Ilan Schnell, Nathan Goldbaum, conda - Public
Excellent, looking at its page this looks like exactly what I need.
Just so I know, is there anything that "source activate" does that
conda-workon doesn't do at this time? Or are they on feature parity?
Thanks!

Floris Bruynooghe

unread,
Apr 10, 2016, 5:57:22 PM4/10/16
to Advrk Aplmrkt, Ilan Schnell, Nathan Goldbaum, conda - Public
On 8 April 2016 at 10:57, Advrk Aplmrkt <avka...@gmail.com> wrote:
> On 08/04/2016, Floris Bruynooghe <fl...@devork.be> wrote:
>> On 28 March 2016 at 08:58, Advrk Aplmrkt <avka...@gmail.com> wrote:
>>> I see, thank you both for your answers.
>>>
>>> Is there a possible workaround with fish right now? Or would it be
>>> easier if I just stuck with bash for now?
>>
>> I use conda-workon with fish which works just fine (disclaimer, I'm
>> the author). You can find it on pypi.
>>
>
> Excellent, looking at its page this looks like exactly what I need.
> Just so I know, is there anything that "source activate" does that
> conda-workon doesn't do at this time? Or are they on feature parity?

Erm, from memory:

- "source activate" tries to modify the prompt for you automatically.
You may or may not liket that.
- new shell vs same shell, obviously
- conda-workon implements temporary envs (though I think the syntax is
not great currently and have been meaning to change/fix/break
backwards compat for months - I may get round to that one day)

Regards,
Floris

Tim Hopper

unread,
May 4, 2016, 10:01:40 AM5/4/16
to conda - Public, natha...@gmail.com, avka...@gmail.com
Ilan —

Any idea when this functionality will be released?

Advrk Aplmrkt

unread,
May 28, 2016, 9:40:04 AM5/28/16
to Floris Bruynooghe, Ilan Schnell, Nathan Goldbaum, conda - Public
Hello again,

I've been trying to use conda-workon, but when I added the fish_prompt
function as on the Bitbucket page and started an environment, I get
this error:

----------

fish: Unknown command 'red'
~/.config/fish/functions/fish_prompt.fish (line 2): red
^
in command substitution
called on line -1 of file ~/.config/fish/functions/fish_prompt.fish

from sourcing file ~/.config/fish/functions/fish_prompt.fish
called on standard input

in command substitution
called on standard input

----------

I'm not familiar with how to do this kind of customisation, what is
wrong here? Thank you.

On 08/04/2016, Floris Bruynooghe <fl...@devork.be> wrote:

Anderson Silva

unread,
Sep 20, 2017, 10:06:45 PM9/20/17
to conda - Public, fl...@devork.be, il...@continuum.io, natha...@gmail.com
Hi Advkr

Hello, I hope you have solved the problem using fish with conda, I had the same problem here at the moment.

I could not use the 'source activate MyEnv', inside the fish shell.

For now when I need to manage environments, i just exit the fish, login into bash, run the command 'source activate MyEnv', 
and log in to Fish again. In my case this worked as a workaround. By the way have you solved your problem? How?

Paul A. Simpson

unread,
Sep 20, 2017, 10:41:56 PM9/20/17
to conda - Public, fl...@devork.be, il...@continuum.io, natha...@gmail.com
I have conda 4.3.25 (the latest stable release) working on fish shell. I use "conda activate <env>" to activate my environments and "conda deactivate" to deactivate them.

I had to add three lines to my config.fish to get things to work properly, while still allowing me to access my system install of Python (which may not be required, but I prefer it). I'm new to fish and conda so there may be a better way to do it, but this has worked for me:









# Conda startup script


source ~/miniconda3/etc/fish/conf.d/conda.fish




# Path to system Python3


set fish_user_paths $fish_user_paths /Library/Frameworks/Python.framework/Versions/3.6/bin/




# For Conda < 4.4.0 prepend Conda path to fish path (should be removable in Conda 4.4.0+)


set fish_user_paths $fish_user_paths ~/miniconda3/bin/



Advrk Aplmrkt

unread,
Sep 24, 2017, 4:34:47 PM9/24/17
to Paul A. Simpson, conda - Public, fl...@devork.be, il...@continuum.io, natha...@gmail.com
Hi all,

To be honest I gave up after a while!!! Is there now a more "official"
way to use conda environments with fish?
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "conda - Public" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/a/continuum.io/d/topic/conda/8aaYESlLZI8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> conda+un...@continuum.io.
> To post to this group, send email to co...@continuum.io.
> Visit this group at https://groups.google.com/a/continuum.io/group/conda/.
> To view this discussion on the web visit
> https://groups.google.com/a/continuum.io/d/msgid/conda/4eb64c04-7bb8-4dea-bb79-e7c438d4d0bf%40continuum.io.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout.
>

Paul A. Simpson

unread,
Sep 24, 2017, 6:25:16 PM9/24/17
to conda - Public, paul.x....@gmail.com, fl...@devork.be, il...@continuum.io, natha...@gmail.com
Did the solution I posted not work for you? As far as I am aware, that is the official way; it's just poorly documented.

Advrk Aplmrkt

unread,
Sep 27, 2017, 4:54:28 AM9/27/17
to Paul A. Simpson, conda - Public, fl...@devork.be, il...@continuum.io, natha...@gmail.com
Ooops! Sorry I got confused, yes I'll use your solution. Now I just
need to figure out how to get IDEs (e.g. Emacs, PyCharm, or Rodeo) to
be fully "aware" of Conda environments... Thank you!

On 24/09/2017, Paul A. Simpson <paul.x....@gmail.com> wrote:
> Did the solution I posted not work for you? As far as I am aware, that is
> the official way; it's just poorly documented.
>
>
> On Sunday, September 24, 2017 at 3:34:47 PM UTC-5, Advrk Aplmrkt wrote:
>>
>> Hi all,
>>
>> To be honest I gave up after a while!!! Is there now a more "official"
>> way to use conda environments with fish?
>>
>> On 21/09/2017, Paul A. Simpson <paul.x....@gmail.com <javascript:>>
>> > conda+un...@continuum.io <javascript:>.
>> > To post to this group, send email to co...@continuum.io <javascript:>.
>> > Visit this group at
>> https://groups.google.com/a/continuum.io/group/conda/.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/a/continuum.io/d/msgid/conda/4eb64c04-7bb8-4dea-bb79-e7c438d4d0bf%40continuum.io.
>>
>>
>> > For more options, visit
>> https://groups.google.com/a/continuum.io/d/optout.
>> >
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "conda - Public" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/a/continuum.io/d/topic/conda/8aaYESlLZI8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> conda+un...@continuum.io.
> To post to this group, send email to co...@continuum.io.
> Visit this group at https://groups.google.com/a/continuum.io/group/conda/.
> To view this discussion on the web visit
> https://groups.google.com/a/continuum.io/d/msgid/conda/c33fcb9d-0496-4f9e-a5e1-46b159b25771%40continuum.io.

Floris Bruynooghe

unread,
Sep 28, 2017, 3:01:43 PM9/28/17
to Advrk Aplmrkt, Paul A. Simpson, conda - Public, il...@continuum.io, natha...@gmail.com
Advrk Aplmrkt <avka...@gmail.com> writes:

> Ooops! Sorry I got confused, yes I'll use your solution. Now I just
> need to figure out how to get IDEs (e.g. Emacs, PyCharm, or Rodeo) to
> be fully "aware" of Conda environments... Thank you!

For emacs using elpy and M-x pyvenv-activate will prompt you for the
directory of the virtualenv. Pointing that to the directory of the
conda environment makes everything work like with an ordinary
virtualenv, as in, seamless.

Advrk Aplmrkt

unread,
Sep 28, 2017, 4:42:50 PM9/28/17
to Floris Bruynooghe, Paul A. Simpson, conda - Public, il...@continuum.io, natha...@gmail.com
Thank you Floris! Does this mean that conda environments and
virtualenv environments are actually built the same, and that's why
Emacs with elpy can't see a difference between them?

Floris Bruynooghe

unread,
Sep 30, 2017, 2:53:07 PM9/30/17
to Advrk Aplmrkt, Paul A. Simpson, conda - Public, il...@continuum.io, natha...@gmail.com
At some level you can consider them both as basically a bin directory which
you should prepend to your PATH to use the tools which live there. This
simple view gets you a surprisingly long way.

Cheers,
Floris
Reply all
Reply to author
Forward
0 new messages