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

[BUG] FVA doesn work on windows 11 and Python 3.12.7 #1410

Open
1 task done
merlin-von-deggendorf opened this issue Oct 23, 2024 · 2 comments
Open
1 task done

[BUG] FVA doesn work on windows 11 and Python 3.12.7 #1410

merlin-von-deggendorf opened this issue Oct 23, 2024 · 2 comments
Labels

Comments

@merlin-von-deggendorf
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

No response

Code sample

Code run:

from cobra.io import load_model
from cobra.flux_analysis import flux_variability_analysis

model = load_model("textbook")
# for reaction in model.reactions:
#     print(reaction.id,end=" ")
solution=flux_variability_analysis(model,model.reactions[:len(model.reactions)-1])

Traceback:

File "C:\Program Files\Python312\Lib\multiprocessing\context.py", line 119, in Pool
    self._repopulate_pool()
  File "C:\Program Files\Python312\Lib\multiprocessing\pool.py", line 306, in _repopulate_pool
    return Pool(processes, initializer, initargs, maxtasksperchild,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    return self._repopulate_pool_static(self._ctx, self.Process,
  File "C:\Program Files\Python312\Lib\multiprocessing\pool.py", line 215, in __init__
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\multiprocessing\pool.py", line 329, in _repopulate_pool_static     
    self._repopulate_pool()
  File "C:\Program Files\Python312\Lib\multiprocessing\pool.py", line 306, in _repopulate_pool
    w.start()
  File "C:\Program Files\Python312\Lib\multiprocessing\process.py", line 121, in start
    return self._repopulate_pool_static(self._ctx, self.Process,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    self._popen = self._Popen(self)
  File "C:\Program Files\Python312\Lib\multiprocessing\pool.py", line 329, in _repopulate_pool_static     
                  ^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\multiprocessing\context.py", line 337, in _Popen
    w.start()
  File "C:\Program Files\Python312\Lib\multiprocessing\process.py", line 121, in start
    return Popen(process_obj)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\multiprocessing\popen_spawn_win32.py", line 46, in __init__        
    self._popen = self._Popen(self)
                  ^^^^^^^^^^^^^^^^^
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "C:\Program Files\Python312\Lib\multiprocessing\context.py", line 337, in _Popen
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\multiprocessing\spawn.py", line 164, in get_preparation_data       
    return Popen(process_obj)
           ^^^^^^^^^^^^^^^^^^
    _check_not_importing_main()
  File "C:\Program Files\Python312\Lib\multiprocessing\popen_spawn_win32.py", line 46, in __init__        
  File "C:\Program Files\Python312\Lib\multiprocessing\spawn.py", line 140, in _check_not_importing_main  
    prep_data = spawn.get_preparation_data(process_obj._name)
    raise RuntimeError('''
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
          File "C:\Program Files\Python312\Lib\multiprocessing\spawn.py", line 164, in get_preparation_data

    _check_not_importing_main()
  File "C:\Program Files\Python312\Lib\multiprocessing\spawn.py", line 140, in _check_not_importing_main  
    raise RuntimeError('''
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

Environment

PS C:\code\cobrapytut> depinfo --markdown cobra

Package Information

Package Version
cobra 0.29.1

Dependency Information

Package Version
appdirs~ missing
black missing
bumpversion missing
depinfo~ missing
diskcache~ missing
future 1.0.0
httpx~ missing
importlib-resources 6.4.5
isort missing
numpy 1.26.3
optlang~ missing
pandas 2.2.3
pydantic 2.9.2
python-libsbml~ missing
rich 13.9.2
ruamel.yaml~ missing
scipy 1.14.1
swiglpk 5.0.10
tox missing

Build Tools Information

Package Version
pip 24.2
setuptools 70.0.0

Platform Information

Windows 11-AMD64
CPython 3.12.7

Anything else?

No response

@Midnighter
Copy link
Member

FVA is regularly tested on Windows with Python 3.11. Are you able to switch to that version until we have figured out the problem?

@merlin-von-deggendorf
Copy link
Author

sure, I'm just reading through the tutorial, so I don't need the feature right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants