Skip to content

raise RuntimeError in spawn.py #167

Open
@mmuuyyii

Description

Hi,
I'm trying to run example data in db5.0 with PyCharm and python 3.11.7 as the notebook guides:

import cellphonedb
import pandas as pd
import sys
import os

cpdb_file_path = 'cellphonedb.zip'
meta_file_path = 'test_meta.txt'
counts_file_path = 'test_counts.txt' # I also try h5ad
from cellphonedb.src.core.methods import cpdb_statistical_analysis_method
deconvoluted, means, pvalues, significant_means = cpdb_statistical_analysis_method.call(
cpdb_file_path = cpdb_file_path,
meta_file_path = meta_file_path,
counts_file_path = counts_file_path,
counts_data = 'ensembl',
output_path = "cpdb")

When I run the code, the program goes to endless loop.
When I debug the code, I get the error in "spawn.py":

def _check_not_importing_main():
if getattr(process.current_process(), '_inheriting', False):
raise RuntimeError('''
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

    To fix this issue, refer to the "Safe importing of main module"
    section in https://docs.python.org/3/library/multiprocessing.html
    ''')

Could you please teach me what should I do?
Thanks a million.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions