what is the error here
(source (mambainfo−−base)/etc/profile.d/cond(mamba info --base)/etc/profile.d/mamba.sh; mamba activate ; mamba activate ff-mission-dashboard-env; streamlit run app/entry.py --server.port 8503)
/home/mcc/miniforge3/condabin/mamba: line 4: import: command not found
/home/mcc/miniforge3/condabin/mamba: line 5: import: command not found
/home/mcc/miniforge3/condabin/mamba: line 7: from: command not found
/home/mcc/miniforge3/condabin/mamba: line 10: syntax error near unexpected token sys.argv[0] = re.sub(r'(-script.pyw?|.exe)?', '', sys.argv[0])'
Run 'mamba init' to be able to run mamba activate/deactivate
and start a new shell session. Or use conda to activate/deactivate.
Assistant
a
.
s
h
;
so
u
r
ce
(' /home/mcc/miniforge3/condabin/mamba: line 10:
′,′′,sys.argv[0])′/home/mcc/miniforge3/con
Run 'mamba init' to be able to run mamba activate/deactivate
and start a new shell session. Or use conda to activate/deactivate.
Collecting usage statistics. To deactivate, set browser.gatherUsageStats to false.
The error messages indicate that the script mamba is being executed as a shell script (bash or sh), but the file actually contains Python code. That's why you are seeing errors like:
code
import: command not found
from: command not found
syntax error near unexpected token `('
These are Python statements that the shell tries to interpret as shell commands. This typically happens if:
The mamba executable at /home/mcc/miniforge3/condabin/mamba is either a Python script without the right shebang line, or
The mamba command is invoked without the right interpreter or environment, or
The shell is looking at a wrong mamba script due to PATH misconfiguration.
How to fix this
1. Check the mamba executable
Run:
bash
head -n 5 /home/mcc/miniforge3/condabin/mamba
If the top lines do not start with something like #!/usr/bin/env python or another interpreter, or if it's a Python script without a shebang, the shell will interpret it as a shell script and fail.
mamba should typically be a binary or correctly packaged wrapper, not a raw Python script.
2. Ensure mamba is installed correctly
Try re-installing or updating mamba through conda:
bash
conda install -c conda-forge mamba
3. Run mamba init
The error message says:
code
Run 'mamba init' to be able to run mamba activate/deactivate
and start a new shell session.
Run this command once:
bash
mamba init
Then close and reopen your terminal, or source your shell config:
No need to activate base environment explicitly twice.
Make sure your shell is properly setup (after mamba init) so mamba activate works as expected.
Summary
The core issue is that the system is trying to run mamba as a shell script, but it's actually Python code.
Run mamba init and restart shell first
Confirm mamba is installed correctly and executable
Check the mamba file for a valid shebang (should not be a raw Python script)
Use correct environment activation commands afterward
If after this you still have issues, a workaround is to run conda activate commands directly or run streamlit within an already activated environment. For example:
bash
mamba activate ff-mission-dashboard-env
streamlit run app/entry.py --server.port 8503
instead of trying to do it all in one line with chained commands inside ( ... ).
If you provide more details about your shell type and how mamba was installed, I can help debug further.