dundalek / closh

Bash-like shell based on Clojure
Eclipse Public License 1.0
1.62k stars 66 forks source link

[QUESTION] How to use conda? #69

Closed NightMachinery closed 6 years ago

NightMachinery commented 6 years ago

Conda uses a .sh script to start itself up, and running that script via source-shell does no good.

 $ conda activate

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 ". /Users/evar/anaconda/etc/profile.d/conda.sh" >> ~/.bash_profile

or, for all users, enable conda with

    $ sudo ln -s /Users/evar/anaconda/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" >> ~/.bash_profile

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

    export PATH="/Users/evar/anaconda/bin:$PATH"

^^^ The above line should NO LONGER be in your ~/.bash_profile file! ^^^
dundalek commented 6 years ago

I am not familiar with conda, but from the docs you posted it seems that the result of the conda activate is the thing that needs to be sourced. So this might do the trick:

(source-shell (sh-str conda activate))
NightMachinery commented 6 years ago

Unfortunately it doesn't work, it uses custom bash functions it seems ... It'd be good to add automatic bash-to-closh script conversion to the roadmap?

On Thu, Mar 29, 2018 at 6:03 PM, Jakub Dundalek notifications@github.com wrote:

I am not familiar with conda, but from the docs you posted it seems that the result of the conda activate is the thing that needs to be sourced. So this might do the trick:

(source-shell (sh-str conda activate))

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dundalek/closh/issues/69#issuecomment-377236349, or mute the thread https://github.com/notifications/unsubscribe-auth/Aii--nuG8qC37KcBC8pTtNemenIm8H9Nks5tjOLAgaJpZM4S_Vyi .

dundalek commented 6 years ago

I see, I overlooked some details. Maybe try:

(source-shell "bash" "/Users/evar/anaconda/etc/profile.d/conda.sh")
(source-shell "conda activate")
dundalek commented 6 years ago

@NightMachinary Were you able to run conda with those last commands?

NightMachinery commented 6 years ago

No, it returns errors:

On Sat, Apr 14, 2018 at 3:55 PM, Jakub Dundalek notifications@github.com wrote:

@NightMachinary https://github.com/NightMachinary Were you able to run conda with those last commands?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dundalek/closh/issues/69#issuecomment-381322510, or mute the thread https://github.com/notifications/unsubscribe-auth/Aii--lz0krPnvJp6lkvsLW1mAV0g96TVks5todykgaJpZM4S_Vyi .

dundalek commented 6 years ago

Could you provide the error output?

NightMachinery commented 6 years ago

@dundalek Oh, I had included an image of the error but it was lost during the mail to github conversion it seems. Here you go: image

dundalek commented 6 years ago

@NightMachinary I just tried conda in a VM, and I think I got it now:

(source-shell ". ~/anaconda/etc/profile.d/conda.sh; conda activate")

Thanks for your patience.

NightMachinery commented 6 years ago

Thanks! This seems to work properly.

On Sun, Apr 15, 2018 at 7:41 PM, Jakub Dundalek notifications@github.com wrote:

@NightMachinary https://github.com/NightMachinary I just tried conda in a VM, and I think I got it now:

(source-shell ". ~/anaconda/etc/profile.d/conda.sh; conda activate")

Thanks for your patience.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dundalek/closh/issues/69#issuecomment-381413708, or mute the thread https://github.com/notifications/unsubscribe-auth/Aii--kJkaOKNTpB0eOxAZe0pMYH3C2WXks5to2MjgaJpZM4S_Vyi .

dundalek commented 6 years ago

Cool!