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

ImportError: sys.meta_path is None, Python is likely shutting down #360

Open
Tanzongyouyi opened this issue May 7, 2024 · 2 comments
Open

Comments

@Tanzongyouyi
Copy link

C:\Users\27012>python -m pysc2.bin.agent --map Simple64
pygame 2.5.2 (SDL 2.28.3, Python 3.12.3)
Hello from the pygame community. https://www.pygame.org/contribute.html
I0507 23:27:35.410878 24656 sc_process.py:130] Launching SC2: D:/StarCraft II\Versions/Base92174\SC2_x64.exe -listen 127.0.0.1 -port 33944 -dataDir D:/StarCraft II\ -tempDir C:\Users\27012\AppData\Local\Temp\sc-6812wxhd\ -displayMode 0 -windowwidth 640 -windowheight 480 -windowx 50 -windowy 50
I0507 23:27:35.566763 24656 remote_controller.py:162] Connecting to: ws://127.0.0.1:33944/sc2api, attempt: 0, running: True
I0507 23:27:38.611933 24656 remote_controller.py:162] Connecting to: ws://127.0.0.1:33944/sc2api, attempt: 1, running: True
I0507 23:27:41.642435 24656 remote_controller.py:162] Connecting to: ws://127.0.0.1:33944/sc2api, attempt: 2, running: True
I0507 23:27:44.678656 24656 remote_controller.py:162] Connecting to: ws://127.0.0.1:33944/sc2api, attempt: 3, running: True
I0507 23:27:47.716806 24656 remote_controller.py:162] Connecting to: ws://127.0.0.1:33944/sc2api, attempt: 4, running: True
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\bin\agent.py", line 159, in
app.run(main)
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\absl\app.py", line 308, in run
_run_main(main, args)
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\absl\app.py", line 254, in _run_main
sys.exit(main(argv))
^^^^^^^^^^
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\bin\agent.py", line 145, in main
run_thread(agent_classes, players, FLAGS.map, FLAGS.render)
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\bin\agent.py", line 85, in run_thread
with sc2_env.SC2Env(
^^^^^^^^^^^^^^^
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\env\sc2_env.py", line 262, in init
self._create_join()
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\env\sc2_env.py", line 376, in _create_join
map_data = map_inst.data(self._run_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\maps\lib.py", line 84, in data
return run_config.map_data(self.path, self.players)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\run_configs\lib.py", line 142, in map_data
raise ValueError(f"Map {map_name} not found in {self.data_dir}/Maps.")
ValueError: Map Melee\Simple64.SC2Map not found in D:/StarCraft II/Maps.
I0507 23:27:48.654233 24656 sc2_env.py:740] Environment Close
Exception ignored in: <function Base.del at 0x000002A4391F8B80>
Traceback (most recent call last):
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\env\environment.py", line 153, in del
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\env\sc2_env.py", line 751, in close
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\lib\remote_controller.py", line 81, in _skip_status
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\lib\stopwatch.py", line 205, in _stopwatch
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\lib\remote_controller.py", line 364, in quit
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\lib\stopwatch.py", line 205, in _stopwatch
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\lib\protocol.py", line 122, in write
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\lib\protocol.py", line 189, in _write
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\google\protobuf\internal\python_message.py", line 1086, in SerializeToString
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\google\protobuf\internal\python_message.py", line 1095, in SerializePartialToString
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\google\protobuf\internal\python_message.py", line 1115, in InternalSerialize
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\google\protobuf\internal\encoder.py", line 767, in EncodeField
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\google\protobuf\internal\python_message.py", line 1059, in ByteSize
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\google\protobuf\descriptor.py", line 166, in GetOptions
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function StarcraftProcess.del at 0x000002A43B757B00>
Traceback (most recent call last):
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\lib\sc_process.py", line 182, in del
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\lib\stopwatch.py", line 205, in _stopwatch
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\lib\sc_process.py", line 150, in close
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\lib\sc_process.py", line 204, in _shutdown
File "C:\Users\27012\AppData\Local\Programs\Python\Python312\Lib\site-packages\pysc2\lib\sc_process.py", line 229, in _shutdown_proc
OSError: [WinError 6] 句柄无效。

How can I solve this problem?

@toncula
Copy link

toncula commented May 11, 2024

same issue :(

@toncula
Copy link

toncula commented May 11, 2024

It seems SimpleMap64 are not placed in SC2/maps properly
ValueError: Map Melee\Simple64.SC2Map not found in D:/StarCraft II/Maps

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

No branches or pull requests

2 participants