unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#27858: Conda (on guix) does not activate environments
@ 2017-07-28  5:49 Frederick Muriithi
  2017-07-28  9:36 ` Pjotr Prins
  0 siblings, 1 reply; 5+ messages in thread
From: Frederick Muriithi @ 2017-07-28  5:49 UTC (permalink / raw)
  To: 27858

I have come across a bug on conda, installed via guix, that does not
seem to be present when conda is installed via the process at
https://conda.io/docs/install/quick.html#linux-miniconda-install

The issue
---------
Conda (on guix) does not activate environments

Command ran
-----------
source activate test-env

Expected result
---------------
The envinment should be activated, and the prompt changes from
`frederick@localhost:/tmp$` to `(test-guix-conda)
frederick@localhost:/tmp$`

Actual result
-------------
The terminal window is exited.

Additional information
----------------------
This behaviour is not present on conda installed via the process
presented in the conda documentation.

The environment(s) created by conda on guix are available on, and can
be activated by conda installed via the process in the conda
documentation.

I ran `bash -c "source activate test-env"` and the following error
message was displayed:

/gnu/store/f2dr9xbimg93pljm7xgmqb4cm5bxy98r-conda-4.3.16/bin/.deactivate-real:
line 59: return: can only `return' from a function or sourced script
/gnu/store/f2dr9xbimg93pljm7xgmqb4cm5bxy98r-conda-4.3.16/bin/.deactivate-real:
line 94: return: can only `return' from a function or sourced script

I would appreciate any help that would help in resolving this issue.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#27858: Conda (on guix) does not activate environments
  2017-07-28  5:49 bug#27858: Conda (on guix) does not activate environments Frederick Muriithi
@ 2017-07-28  9:36 ` Pjotr Prins
  2017-07-28  9:42   ` Frederick Muriithi
  2017-07-28 10:20   ` Frederick Muriithi
  0 siblings, 2 replies; 5+ messages in thread
From: Pjotr Prins @ 2017-07-28  9:36 UTC (permalink / raw)
  To: Frederick Muriithi; +Cc: 27858

Hi Fred,

Can you send the exact commands you are using so we can replicate the
issue?

Pj.

-- 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#27858: Conda (on guix) does not activate environments
  2017-07-28  9:36 ` Pjotr Prins
@ 2017-07-28  9:42   ` Frederick Muriithi
  2021-02-01 19:37     ` Maxim Cournoyer
  2017-07-28 10:20   ` Frederick Muriithi
  1 sibling, 1 reply; 5+ messages in thread
From: Frederick Muriithi @ 2017-07-28  9:42 UTC (permalink / raw)
  To: Pjotr Prins; +Cc: 27858

1) Install conda into a profile:

    guix package --install=conda --profile=$HOME/guix_profiles/conda

2) Activate the profile:

    source $HOME/guix_profiles/conda/etc/profile

3) Create an environment with conda and install biopython

    conda create --name test-env biopython

4) Try to activate the environment (here's where it fails)

    source activate test-env

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#27858: Conda (on guix) does not activate environments
  2017-07-28  9:36 ` Pjotr Prins
  2017-07-28  9:42   ` Frederick Muriithi
@ 2017-07-28 10:20   ` Frederick Muriithi
  1 sibling, 0 replies; 5+ messages in thread
From: Frederick Muriithi @ 2017-07-28 10:20 UTC (permalink / raw)
  To: Pjotr Prins; +Cc: 27858

Additional Information

When installed from conda's documentation, conda installs the
following packages into conda's root environment by default:

asn1crypto, cffi, conda, conda-env, cryptography, idna, libffi,
openssl, packaging, pip, pycosat, pycparser, pyopenssl, pyparsing,
python, readline, requests, ruamel_yaml, setuptools, six, sqlite, tk,
wheel, xz, yaml, zlib


These do not exists in the root environment of the conda installed via guix.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#27858: Conda (on guix) does not activate environments
  2017-07-28  9:42   ` Frederick Muriithi
@ 2021-02-01 19:37     ` Maxim Cournoyer
  0 siblings, 0 replies; 5+ messages in thread
From: Maxim Cournoyer @ 2021-02-01 19:37 UTC (permalink / raw)
  To: Frederick Muriithi; +Cc: 27858-done

Hello,

Frederick Muriithi <fredmanglis@gmail.com> writes:

> 1) Install conda into a profile:
>
>     guix package --install=conda --profile=$HOME/guix_profiles/conda
>
> 2) Activate the profile:
>
>     source $HOME/guix_profiles/conda/etc/profile
>
> 3) Create an environment with conda and install biopython
>
>     conda create --name test-env biopython
>
> 4) Try to activate the environment (here's where it fails)
>
>     source activate test-env

I had never used conda before, so I was a bit surprised that it sneeked
that into my ~/.bashrc:

diff --git a/bash/.bashrc b/bash/.bashrc
index d0635bc..169b2c8 100644
--- a/bash/.bashrc
+++ b/bash/.bashrc
@@ -119,3 +119,19 @@ function up()
     cd "$dir"
     echo "info: now in $PWD [Git repo]"
 }
+
+# >>> conda initialize >>>
+# !! Contents within this block are managed by 'conda init' !!
+__conda_setup="$('/gnu/store/pjkxdaryj97yffhjxql2q4wpzs70hpa3-conda-4.8.3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
+if [ $? -eq 0 ]; then
+    eval "$__conda_setup"
+else
+    if [ -f "/gnu/store/pjkxdaryj97yffhjxql2q4wpzs70hpa3-conda-4.8.3/etc/profile.d/conda.sh" ]; then
+        . "/gnu/store/pjkxdaryj97yffhjxql2q4wpzs70hpa3-conda-4.8.3/etc/profile.d/conda.sh"
+    else
+        export PATH="/gnu/store/pjkxdaryj97yffhjxql2q4wpzs70hpa3-conda-4.8.3/bin:$PATH"
+    fi
+fi
+unset __conda_setup
+# <<< conda initialize <<<
+

and required the presence of the 'sudo' command to be happy.

With that said,

$ guix environment --pure --ad-hoc conda bash coreutils sudo

(base) $ conda create --name test-env biopython

Then the suggested:

(base) $ conda activate test-env

(test-env) $

So, it seems to work.

Closing.

Maxim




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-01 19:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-28  5:49 bug#27858: Conda (on guix) does not activate environments Frederick Muriithi
2017-07-28  9:36 ` Pjotr Prins
2017-07-28  9:42   ` Frederick Muriithi
2021-02-01 19:37     ` Maxim Cournoyer
2017-07-28 10:20   ` Frederick Muriithi

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).