setup-miniconda
setup-miniconda copied to clipboard
ImportError: No module named conda.cli
Hey, i have a really strange problem.
I have two projects where i use the same identical workflow:
...
steps:
- name: Checkout branch
uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: test
...
The problem is that in one project, it works fine, while in the other i have the following error:
Traceback (most recent call last):
File ".../condabin/conda", line 12, in <module>
from conda.cli import main
Warning: ImportError: No module named conda.cli
Do you have an idea what can be? I'm using self-hosted runner.
Thanks :-)
Do you have full workflows somebody could use to reproduce this behavior? Logs?
This is the complete workflow
name: Linting with Ruff
on:
pull_request:
branches:
- '**' # the workflow is activated on every PR
jobs:
linting_with_ruff:
name: Linting with Ruff
runs-on: self-hosted
steps:
- name: Checkout branch
uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: ruff
- name: Install Ruff
shell: bash -el {0}
run: |
conda activate ruff
conda install -c conda-forge ruff
- name: Linting with Ruff
shell: bash -el {0}
run: |
ruff check . --config=ruff.toml
- The workflow crashes at the step
uses: conda-incubator/setup-miniconda@v2
- I have another repository with the same (copy/paste) workflow and in the other repository works
- can it be that it is because of some env variables? Like PATH. I don't know how
conda-incubator/setup-miniconda@v2
works under the hood
thank you for your help
Dors your repo contain a conda
directory by any chance?
No. There is no conda
directory.
Can you share full logs? Thanks!
/disk2/home/github/self-hosted/01/_work/project_dir/project_source/3/condabin/conda config --add pkgs_dirs /disk2/home/github/conda_pkgs_dir
Warning: Traceback (most recent call last):
File "/disk2/home/github/self-hosted/01/_work/project_dir/project_source/3/condabin/conda", line 12, in <module>
from conda.cli import main
ImportError
Traceback (most recent call last):
File "/disk2/home/github/self-hosted/01/_work/project_dir/project_source/3/condabin/conda", line 12, in <module>
from conda.cli import main
ImportError::warning::: No module named conda.cli%0A
: No module named conda.cli
Error: The process '/disk2/home/github/self-hosted/01/_work/project_dir/project_source/3/condabin/conda' failed with exit code 1
This is the log of the error i have from the workflow
With that amount of info is hard to say, but it could be one of:
- A different
python
is being invoked (checkPATH
) - A different site-packages is being search (check
PYTHONPATH
)
With the full logs as provided by the GHA download would allow me to check more things. If they are confidential, you can share them by email or Element?
I think the issue might be related to "I'm using self-hosted runner"