Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get an error about the imp module in python12 #3173

Closed
kojix2 opened this issue Sep 17, 2024 · 2 comments
Closed

I get an error about the imp module in python12 #3173

kojix2 opened this issue Sep 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@kojix2
Copy link
Member

kojix2 commented Sep 17, 2024

Description of the bug

Hello,

I have installed nf-core and Nextflow using Micromamba. The installation was successful, but when I run the nf-core command, I receive the following error:

Traceback (most recent call last):
  File "/Users/kojix2/miniconda3/envs/nextflow/bin/nf-core", line 7, in <module>
    from nf_core.__main__ import run_nf_core
  File "/Users/kojix2/miniconda3/envs/nextflow/lib/python3.12/site-packages/nf_core/__main__.py", line 19, in <module>
    import nf_core.lint
  File "/Users/kojix2/miniconda3/envs/nextflow/lib/python3.12/site-packages/nf_core/lint/__init__.py", line 22, in <module>
    import nf_core.modules.lint
  File "/Users/kojix2/miniconda3/envs/nextflow/lib/python3.12/site-packages/nf_core/modules/__init__.py", line 12, in <module>
    from .mulled import MulledImageNameGenerator
  File "/Users/kojix2/miniconda3/envs/nextflow/lib/python3.12/site-packages/nf_core/modules/mulled.py", line 10, in <module>
    from galaxy.tool_util.deps.mulled.util import build_target, v2_image_name
  File "/Users/kojix2/miniconda3/envs/nextflow/lib/python3.12/site-packages/galaxy/tool_util/deps/__init__.py", line 10, in <module>
    from galaxy.util import (
  File "/Users/kojix2/miniconda3/envs/nextflow/lib/python3.12/site-packages/galaxy/util/__init__.py", line 74, in <module>
    from .path import safe_contains, safe_makedirs, safe_relpath  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kojix2/miniconda3/envs/nextflow/lib/python3.12/site-packages/galaxy/util/path/__init__.py", line 5, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'

I believe this issue is related to the removal of the imp module in Python 3.12. While this seems to be a Galaxy-related issue and not directly caused by nf-core, I wanted to report it here for reference, as the error still occurs even after following the installation steps in the README.

In my case, the simplest solution was to downgrade to Python 3.11:

conda install python=11

Thank you!

Command used and terminal output

conda create --name nextflow python=3.12 nf-core nextflow
conda activate nextflow
nf-core

System information

Apple M2 macOS Sonoma 14.6.1
micromamba 1.5.9
nextflow version 24.04.4.5917
nf-core, version 2.4.1

@kojix2 kojix2 added the bug Something isn't working label Sep 17, 2024
@mirpedrol
Copy link
Member

Hi @kojix2, looks like you are using an old version of nf-core, the current stable version is 2.14.1. I recommend installing the latest version where you shouldn't see this error.

@kojix2
Copy link
Member Author

kojix2 commented Sep 17, 2024

Thank you, I have updated nf-core to the latest version and this error no longer occurs. The reason why the latest nf-core could not be installed automatically is that the version of pytest-workflow was out of date. bioconda has a higher priority than conda-forge and the pytest-workflow registered in bioconda was out of date.

conda search -c bioconda pytest-workflow
Loading channels: done
# Name                       Version           Build  Channel
pytest-workflow                1.1.0            py_0  bioconda
pytest-workflow                1.1.1            py_0  bioconda
pytest-workflow                1.1.2            py_0  bioconda
pytest-workflow                1.2.0            py_0  bioconda
pytest-workflow                1.2.0            py_0  conda-forge
pytest-workflow                1.2.1            py_0  conda-forge
pytest-workflow                1.2.2            py_0  conda-forge
pytest-workflow                1.2.3            py_0  conda-forge
pytest-workflow                1.3.0            py_0  conda-forge
pytest-workflow                1.4.0            py_0  conda-forge
pytest-workflow                1.5.0    pyhd8ed1ab_0  conda-forge
pytest-workflow                1.6.0    pyhd8ed1ab_0  conda-forge
pytest-workflow                2.0.0    pyhd8ed1ab_0  conda-forge
pytest-workflow                2.0.1    pyhd8ed1ab_0  conda-forge
pytest-workflow                2.1.0    pyhd8ed1ab_0  conda-forge

It was necessary to manually upgrade pytest-workflow by specifying the conda-forge channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants