google-deepmind / pysc2

StarCraft II Learning Environment
Apache License 2.0
7.96k stars 1.15k forks source link

TypeError: __init__() got an unexpected keyword argument 'extra_ports' #351

Open 1329844541 opened 1 year ago

1329844541 commented 1 year ago

PS E:\pysc2-master> python -m pysc2.bin.agent --map Simple64 pygame 2.4.0 (SDL 2.26.4, Python 3.9.13) Hello from the pygame community. https://www.pygame.org/contribute.html I0619 23:12:33.051318 20372 sc_process.py:130] Launching SC2: C:/Program Files (x86)/StarCraft II\Versions/Base90136\SC2_x64.exe -listen 127.0.0.1 -port 55882 -dataDir C:/Program Files (x86)/StarCraft II\ -tempDir C:\Users\Mou\AppData\Local\Temp\sc-8vwdku_t\ -displayMode 0 -windowwidth 640 -windowheight 480 -windowx 50 -windowy 50 Traceback (most recent call last): File "D:\ProgramData\Anaconda3\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, self._sc2_procs = [ File "E:\pysc2-master\pysc2\env\sc2_env.py", line 338, in self._run_config.start(extra_ports=self._ports, File "E:\pysc2-master\pysc2\run_configs\platforms.py", line 83, in start return sc_process.StarcraftProcess( File "E:\pysc2-master\pysc2\lib\sc_process.py", line 135, in init self._proc = self._launch(run_config, args, **kwargs) File "E:\pysc2-master\pysc2\lib\sc_process.py", line 195, in _launch return subprocess.Popen( TypeError: init() got an unexpected keyword argument 'extra_ports' I0619 23:12:33.067003 20372 sc2_env.py:740] Environment Close

I have install python3.9,and also run" pip install pysc2",but I can't run the test.Who can help?I truck in this one day.I would be very grateful.

dviraharon commented 11 months ago

In the sc2_env.py , lines 338:

    self._run_config.start(extra_ports=self._ports,
                           want_rgb=interface.HasField("render"))

remove "extra_ports=self.ports" argument, save and relaunch.

I'm running versions: pygame 2.5.0 (SDL 2.28.0, Python 3.10.6) & SC2 4.10 on wsl 2 Ubuntu 22.04, windows 10, will update if this breaks anything else.

Hope this helps.