poker_ai icon indicating copy to clipboard operation
poker_ai copied to clipboard

EOFError after Pip install

Open zanussbaum opened this issue 4 years ago • 17 comments

Describe the bug Installed poker_ai via pip then tried to run poker_ai --help and poker_ai cluster and was met with an EOFError

To Reproduce Steps to reproduce the behavior:

  1. pip install poker_ai
  2. poker_ai --help

Error Message:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/spawn.py", line 125, in _main
    prepare(preparation_data)
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/spawn.py", line 236, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 265, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/bin/poker_ai", line 2, in <module>
    from poker_ai.cli.runner import cli
  File "/usr/local/lib/python3.8/site-packages/poker_ai/__init__.py", line 12, in <module>
    from . import ai
  File "/usr/local/lib/python3.8/site-packages/poker_ai/ai/__init__.py", line 1, in <module>
    from . import multiprocess
  File "/usr/local/lib/python3.8/site-packages/poker_ai/ai/multiprocess/__init__.py", line 1, in <module>
    from . import server
  File "/usr/local/lib/python3.8/site-packages/poker_ai/ai/multiprocess/server.py", line 10, in <module>
    from poker_ai.ai.agent import Agent
  File "/usr/local/lib/python3.8/site-packages/poker_ai/ai/agent.py", line 8, in <module>
    manager = mp.Manager()
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 57, in Manager
    m.start()
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/managers.py", line 579, in start
    self._process.start()
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
    return Popen(process_obj)
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 42, in _launch
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/spawn.py", line 154, in get_preparation_data
    _check_not_importing_main()
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/spawn.py", line 134, 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.
Traceback (most recent call last):
  File "/usr/local/bin/poker_ai", line 2, in <module>
    from poker_ai.cli.runner import cli
  File "/usr/local/lib/python3.8/site-packages/poker_ai/__init__.py", line 12, in <module>
    from . import ai
  File "/usr/local/lib/python3.8/site-packages/poker_ai/ai/__init__.py", line 1, in <module>
    from . import multiprocess
  File "/usr/local/lib/python3.8/site-packages/poker_ai/ai/multiprocess/__init__.py", line 1, in <module>
    from . import server
  File "/usr/local/lib/python3.8/site-packages/poker_ai/ai/multiprocess/server.py", line 10, in <module>
    from poker_ai.ai.agent import Agent
  File "/usr/local/lib/python3.8/site-packages/poker_ai/ai/agent.py", line 8, in <module>
    manager = mp.Manager()
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 57, in Manager
    m.start()
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/managers.py", line 583, in start
    self._address = reader.recv()
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/connection.py", line 250, in recv
    buf = self._recv_bytes()
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/connection.py", line 414, in _recv_bytes
    buf = self._recv(4)
  File "/usr/local/Cellar/[email protected]/3.8.3_2/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/connection.py", line 383, in _recv
    raise EOFError
EOFError

Expected behavior CLI help message

Desktop (please complete the following information):

  • OS: Max
  • Python 3.8.3

zanussbaum avatar Jul 14 '20 18:07 zanussbaum

Thanks for your bug report @zanussbaum . I did test this on a few machines before deploying but I must have not captured your specific case - sorry about that.

Would you be able to try pip installing into a conda, virtualenv or something similar, environment and seeing if that works? I'll install python 3.8 on my Mac and see if I can replicate your problem

fedden avatar Jul 14 '20 18:07 fedden

conda create -n pluribus conda activate pluribus pip install poker_ai poker_ai I don't have a ton of experience with conda, but still getting the same error when doing above.

zanussbaum avatar Jul 14 '20 19:07 zanussbaum

Thanks so much for this @zanussbaum

I've just tried on Linux and Mac OS X, and it's a OS X issue.

If you have a linux distro you can use in the meantime, then please use that (it should be fine on that 🤞), otherwise we'll try to find some time to look into supporting OS X. Although just heads up, we are currently focusing on other projects so PRs are very welcome here and we can't guarentee a timely response 🙂

fedden avatar Jul 14 '20 19:07 fedden

I also encountered this error in Win10, but normally use linux, so I didn't troubleshoot windows too much.

On Tue, Jul 14, 2020 at 2:24 PM Leon Fedden [email protected] wrote:

Thanks so much for this @zanussbaum https://github.com/zanussbaum

I've just tried on Linux and Mac OS X, and it's a OS X issue.

If you have a linux distro you can use in the meantime, then please use that (it should be fine on that 🤞, otherwise we'll try to find some time to look into supporting OS X. Although just heads up, we are currently focusing on other projects so PRs are very welcome here and we can't guarentee a timely response 🙂

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fedden/poker_ai/issues/108#issuecomment-658367115, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOUVXSYOF6BZBMWHZ5N4V4LR3SWFFANCNFSM4OZZIHVA .

Slowly-Grokking avatar Jul 14 '20 20:07 Slowly-Grokking

I wonder if trying python 3.7 would work in the meantime?

big-c-note avatar Jul 14 '20 22:07 big-c-note

hm i'll test it out. either way, i'm excited to try it out!

zanussbaum avatar Jul 14 '20 22:07 zanussbaum

image

johanpettersson1 avatar Aug 06 '20 12:08 johanpettersson1

can you try again with a Linux OS please @johanpettersson1 ?

fedden avatar Aug 06 '20 12:08 fedden

can you try again with a Linux OS please @johanpettersson1 ?

I don't have a linux machine at home sorry :(

johanpettersson1 avatar Aug 06 '20 12:08 johanpettersson1

I was facing similar issues on my Macbook. The fix for this bug was straightforward as indicated here:

I've implemented a fix for it in PR123. Could you please merge?

alexandermaas avatar Nov 23 '20 07:11 alexandermaas

Great Alex. This worked. What is the result of running clustering, my computer needs 6 hours to finish this, does this need to be ran every time or the results can be saved?

amirfarazmand avatar Jul 19 '21 03:07 amirfarazmand

12 hrs and still only here, do I need to run this on a server? C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py:127: RuntimeWarning: 'poker_ai.clustering.runner' found in sys.modules after import of package 'poker_ai.clustering', but prior to execution of 'poker_ai.clustering.runner'; this may result in unpredictable behaviour warn(RuntimeWarning(msg)) 31%|██████████████████████▏ | 181277/581400 [4:32:32<15:19, 435.23it/s]

amirfarazmand avatar Jul 19 '21 11:07 amirfarazmand

24 hrs and still going on a Core i5 vPro CPU, does anyone know how long this will take? I can see a few .joblib files have been created, couldn't someone just copy these files rather than everyone creating these?

amirfarazmand avatar Jul 20 '21 00:07 amirfarazmand

I see this is eventully created after 1.5days card_info_lut.joblib. This should have been really shared.

amirfarazmand avatar Jul 20 '21 12:07 amirfarazmand

This repo seem to have too many issues, this works like a charm: https://github.com/datamllab/rlcard

amirfarazmand avatar Jul 27 '21 11:07 amirfarazmand

Found a simple fix for this, see.

kabua avatar Aug 03 '21 16:08 kabua

MasterAl Github : https://github.com/deeptexas-ai

Challeng Al : https://master.deptexas.ai/aigame/

masterai-top avatar Oct 11 '21 10:10 masterai-top