Command not found with redbiom

Aloha Daniel,
This does not work in jupyter-notebook but does in terminal on Linux Pop OS,
everything else seems fine.

!redbiom fetch qiita-study
--context $ctx
--study-id 2136
--remove-blanks
--output-basename icu

Usage: redbiom fetch qiita-study [OPTIONS]
Try 'redbiom fetch qiita-study --help' for help.
Error: Missing option '--study-id'.

1 Like

Hey @Propolis4651,

Could you try:

!redbiom fetch qiita-study \
--context $ctx \
--study-id 2136 \
--remove-blanks \
--output-basename icu

The \ character can be used to denote a command continues on the following line. Alternatively, in Jupyter Notebook, you can use the cell magic %%bash at the top of the cell, and it should interpret the full cell content as bash commands

Best,
Daniel

1 Like

Tried a few more things without success, both leaving out all \ and %%bash with and without \ which gave even more errors.

!redbiom fetch qiita-study --context $ctx --study-id 2136 --remove-blanks --output-basename icc

Usage: redbiom fetch qiita-study [OPTIONS]
Try 'redbiom fetch qiita-study --help' for help.

Error: Missing option '--study-id'.

%%bash
!redbiom fetch qiita-study --context $ctx --study-id 2136 --remove-blanks --output-basename icc

bash: line 1: !redbiom: command not found

CalledProcessError Traceback (most recent call last)
Cell In[36], line 1
----> 1 get_ipython().run_cell_magic('bash', '', '!redbiom fetch qiita-study --context $ctx --study-id 2136 --remove-blanks --output-basename icc\n')

File ~/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/IPython/core/interactiveshell.py:2430, in InteractiveShell.run_cell_magic(self, magic_name, line, cell)
2428 with self.builtin_trap:
2429 args = (magic_arg_s, cell)
-> 2430 result = fn(*args, **kwargs)
2432 # The code below prevents the output from being displayed
2433 # when using magics with decodator @output_can_be_silenced
2434 # when the last Python token in the expression is a ';'.
2435 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):

File ~/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/IPython/core/magics/script.py:153, in ScriptMagics._make_script_magic..named_script_magic(line, cell)
151 else:
152 line = script
--> 153 return self.shebang(line, cell)

File ~/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/IPython/core/magics/script.py:305, in ScriptMagics.shebang(self, line, cell)
300 if args.raise_error and p.returncode != 0:
301 # If we get here and p.returncode is still None, we must have
302 # killed it but not yet seen its return code. We don't wait for it,
303 # in case it's stuck in uninterruptible sleep. -9 = SIGKILL
304 rc = p.returncode or -9
--> 305 raise CalledProcessError(rc, cell)

CalledProcessError: Command 'b'!redbiom fetch qiita-study --context $ctx --study-id 2136 --remove-blanks --output-basename icc\n'' returned non-zero exit status 127.

And finally

%%bash
!redbiom fetch qiita-study
--context $ctx
--study-id 2136
--remove-blanks
--output-basename icu

bash: line 1: !redbiom: command not found


CalledProcessError Traceback (most recent call last)
Cell In[37], line 1
----> 1 get_ipython().run_cell_magic('bash', '', '!redbiom fetch qiita-study \\n --context $ctx \\n --study-id 2136 \\n --remove-blanks \\n --output-basename icu\n')

File ~/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/IPython/core/interactiveshell.py:2430, in InteractiveShell.run_cell_magic(self, magic_name, line, cell)
2428 with self.builtin_trap:
2429 args = (magic_arg_s, cell)
-> 2430 result = fn(*args, **kwargs)
2432 # The code below prevents the output from being displayed
2433 # when using magics with decodator @output_can_be_silenced
2434 # when the last Python token in the expression is a ';'.
2435 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):

File ~/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/IPython/core/magics/script.py:153, in ScriptMagics._make_script_magic..named_script_magic(line, cell)
151 else:
152 line = script
--> 153 return self.shebang(line, cell)

File ~/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/IPython/core/magics/script.py:305, in ScriptMagics.shebang(self, line, cell)
300 if args.raise_error and p.returncode != 0:
301 # If we get here and p.returncode is still None, we must have
302 # killed it but not yet seen its return code. We don't wait for it,
303 # in case it's stuck in uninterruptible sleep. -9 = SIGKILL
304 rc = p.returncode or -9
--> 305 raise CalledProcessError(rc, cell)

CalledProcessError: Command 'b'!redbiom fetch qiita-study \\n --context $ctx \\n --study-id 2136 \\n --remove-blanks \\n --output-basename icu\n'' returned non-zero exit status 127.

Nothing has worked

Hi @Propolis4651,

The error output is indicating that redbiom is not installed. What I suspect may be going on is that the jupyter notebook is using a different environment than the one you were using on the Linux Pop OS terminal.

Best,
Daniel

1 Like

Aloha Daniel,
Well with some effort for the good or bad I am now able to duplicate the error in both jupyter notebook and terminal.
terminal.
(qiime2-2023.2) johnhasty@pop-os:~/greengenes2$ redbiom fetch qiita-study --context $ctx --study-id 2136 --remove-blanks --output-basename icc
Usage: redbiom fetch qiita-study [OPTIONS]
Try 'redbiom fetch qiita-study --help' for help.

Error: Missing option '--study-id'.

(qiime2-2023.2) johnhasty@pop-os:~/greengenes2$ redbiom --help
Usage: redbiom [OPTIONS] COMMAND [ARGS]...

Options:
--version Show the version and exit.
--help Show this message and exit.

Commands:
admin Update database, etc.
fetch Sample data and metadata retrieval.
search Feature and sample search support.
select Select items based on metadata
summarize Summarize things.

This however corrected the terminal output

(qiime2-2023.2) johnhasty@pop-os:~/greengenes2$ ctx=Deblur_2021.09-Illumina-16S-V4-150nt-ac8c0b
(qiime2-2023.2) johnhasty@pop-os:~/greengenes2$ redbiom fetch qiita-study
--context $ctx
--study-id 2136
--remove-blanks
--output-basename icu

not sure where this came from when i edited my reply??

Commands:

admin Update database, etc.
fetch Sample data and metadata retrieval.
search Feature and sample search support.
select Select items based on metadata
summarize Summarize things.

Hey @Propolis4651,

I split this into a new topic as the focus is on redbiom.

In the first command, my guess is the environment variable $ctx had not been set. As a result, the program was interpreting the string --study-id as the context.

Best,
Daniel

1 Like
                         PROBLEM SOLVED

Guess I should have known to change your example to the following for jupyter-notebook:

!redbiom fetch qiita-study
--context Deblur_2021.09-Illumina-16S-V4-150nt-ac8c0b
--study-id 2136
--remove-blanks
--output-basename icu

Thanks for the lesson. Learning can be difficult sometimes, especially on a new machine.

2 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.