question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RuntimeError: map_path file doesn't exist

See original GitHub issue

Trying to run the simplest bot for testing after installation, results in this:

import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer

class WorkerRushBot(sc2.BotAI):
    async def on_step(self, iteration):
        if iteration == 0:
            for worker in self.workers:
                await self.do(worker.attack(self.enemy_start_locations[0]))

run_game(maps.get("Abyssal Reef LE"), [
    Bot(Race.Zerg, WorkerRushBot()),
    Computer(Race.Protoss, Difficulty.Medium)
], realtime=True)

INFO:sc2.protocol:Client status changed to Status.launched (was None) INFO:sc2.controller:Creating new game INFO:sc2.controller:Map: AbyssalReefLE INFO:sc2.controller:Players: Bot(Race.Zerg, <main.WorkerRushBot object at 0x7f92164b7208>), Computer(Race.Protoss, Difficulty.Medium) CRITICAL:sc2.main:Could not create game: CreateGameError.InvalidMapPath: map_path file doesn’t exist. INFO:sc2.sc2process:kill_switch: Process cleanup INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete INFO:sc2.sc2process:Cleaning up… INFO:sc2.sc2process:Cleanup complete


RuntimeError Traceback (most recent call last) <ipython-input-26-1e52d3a263e6> in <module>() 12 Bot(Race.Zerg, WorkerRushBot()), 13 Computer(Race.Protoss, Difficulty.Medium) —> 14 ], realtime=True)

~/.local/lib/python3.6/site-packages/sc2/main.py in run_game(map_settings, players, **kwargs) 185 result = asyncio.get_event_loop().run_until_complete( 186 _host_game(map_settings, players, **kwargs) –> 187 ) 188 return result

~/anaconda3/lib/python3.6/asyncio/base_events.py in run_until_complete(self, future) 465 raise RuntimeError(‘Event loop stopped before Future completed.’) 466 –> 467 return future.result() 468 469 def stop(self):

~/.local/lib/python3.6/site-packages/sc2/main.py in _host_game(map_settings, players, realtime, portconfig, save_replay_as, step_time_limit, game_time_limit) 110 await server.ping() 111 client = await _setup_host_game(server, map_settings, players, realtime) –> 112 113 try: 114 result = await _play_game(players[0], client, realtime, portconfig, step_time_limit, game_time_limit)

~/.local/lib/python3.6/site-packages/sc2/main.py in _setup_host_game(server, map_settings, players, realtime) 97 err += f": {r.create_game.error_details}" 98 logger.critical(err) —> 99 raise RuntimeError(err) 100 101 return Client(server._ws)

RuntimeError: Could not create game: CreateGameError.InvalidMapPath: map_path file doesn’t exist.

System: Ubuntu 18.04

Downloaded SC2 3.17 linux package from its source: https://github.com/Blizzard/s2client-proto#downloads

Extracted it into /home as is suggested.

Downloaded all 2017-2018 Map Packs and extracted them in Maps inside StarCraft2 folder, in each respective folder.

Any idea whats the issue?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
LecJackScommented, Aug 8, 2018

I realized that I downloaded the linux package version 3.17, while there is a 4.1.2 version.

https://github.com/Blizzard/s2client-proto#downloads

I downloaded that, copied the maps inside Maps, and a new similar exception was raised, but now with a new detail:

INFO:sc2.protocol:Client status changed to Status.launched (was None)
INFO:sc2.controller:Creating new game
INFO:sc2.controller:Map:     AbyssalReefLE
INFO:sc2.controller:Players: Bot(Race.Zerg, <__main__.WorkerRushBot object at 0x7fb11f6ea518>), Computer(Race.Protoss, Difficulty.Medium)
CRITICAL:sc2.main:Could not create game: CreateGameError.InvalidMapPath: map_path '/home/jack/StarCraftII/maps/Ladder2017Season1/AbyssalReefLE.SC2Map' file doesn't exist.
INFO:sc2.sc2process:kill_switch: Process cleanup
INFO:sc2.sc2process:Cleaning up...
INFO:sc2.sc2process:Cleanup complete
INFO:sc2.sc2process:Cleaning up...
INFO:sc2.sc2process:Cleanup complete
INFO:sc2.sc2process:Cleaning up...
INFO:sc2.sc2process:Cleanup complete
INFO:sc2.sc2process:Cleaning up...
INFO:sc2.sc2process:Cleanup complete

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-7-1e52d3a263e6> in <module>()
     12     Bot(Race.Zerg, WorkerRushBot()),
     13     Computer(Race.Protoss, Difficulty.Medium)
---> 14 ], realtime=True)

~/.local/lib/python3.6/site-packages/sc2/main.py in run_game(map_settings, players, **kwargs)
    184     else:
    185         result = asyncio.get_event_loop().run_until_complete(
--> 186             _host_game(map_settings, players, **kwargs)
    187         )
    188     return result

~/anaconda3/lib/python3.6/asyncio/base_events.py in run_until_complete(self, future)
    465             raise RuntimeError('Event loop stopped before Future completed.')
    466 
--> 467         return future.result()
    468 
    469     def stop(self):

~/.local/lib/python3.6/site-packages/sc2/main.py in _host_game(map_settings, players, realtime, portconfig, save_replay_as, step_time_limit, game_time_limit)
    109     async with SC2Process() as server:
    110         await server.ping()
--> 111         client = await _setup_host_game(server, map_settings, players, realtime)
    112 
    113         try:

~/.local/lib/python3.6/site-packages/sc2/main.py in _setup_host_game(server, map_settings, players, realtime)
     97             err += f": {r.create_game.error_details}"
     98         logger.critical(err)
---> 99         raise RuntimeError(err)
    100 
    101     return Client(server._ws)

RuntimeError: Could not create game: CreateGameError.InvalidMapPath: map_path '/home/jack/StarCraftII/maps/Ladder2017Season1/AbyssalReefLE.SC2Map' file doesn't exist.

'/home/jack/StarCraftII/maps/Ladder2017Season1/AbyssalReefLE.SC2Map' file doesn't exist., where maps folder is with lowercase M.

So I duplicate the Maps folder to a new maps folder in the same directory, and the bot started to work 😃

Final directory structure

me:~/StarCraftII$ ls
AppData  Battle.net  Interfaces  Libs  Maps  maps  Replays  SC2Data  Versions
me:~/StarCraftII$ ls Maps/
Ladder2017Season1  Ladder2017Season3  Ladder2018Season1
Ladder2017Season2  Ladder2017Season4  Ladder2018Season2
me:~/StarCraftII$ ls maps/
Ladder2017Season1  Ladder2017Season3  Ladder2018Season1
Ladder2017Season2  Ladder2017Season4  Ladder2018Season2
me:~/StarCraftII$ ls Maps/Ladder2017Season1/
AbyssalReefLE.SC2Map     CactusValleyLE.SC2Map  NewkirkPrecinctTE.SC2Map   ProximaStationLE.SC2Map
BelShirVestigeLE.SC2Map  HonorgroundsLE.SC2Map  PaladinoTerminalLE.SC2Map

@varunbalupuri check if that works for you.

1reaction
BurnySc2commented, Aug 8, 2018

I had the same issue with my docker image. I had to use lower case maps for some reason to fix my problem. https://hub.docker.com/r/burnysc2/python-sc2-docker/~/dockerfile/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server.MapPath - Could not find a part of the path in ASP.net
I need to create that directory to upload the file to my server, but I can't, since everything breaks. How will i fix...
Read more >
Microsoft VBScript runtime error '800a0046' Permission denied 2
Hi guys! I am writing an asp page in order to access a text file on a server, like this: myPath = "\\ServerName\log"...
Read more >
File.Exists(Text) Method - Business Central - Microsoft Learn
Determines whether a file exists. ... optional return value and the operation does not execute successfully, a runtime error will occur.
Read more >
Im having trouble with a file upload saveas command
MapPath (saveFile); if(File.Exists(path)) // This is just to make sure if the file exists or not { fileUploadPhoto.SaveAs(path); } Good luck,
Read more >
Microsoft VBScript runtime error '800a003e' Input past end of file
Find answers to Microsoft VBScript runtime error '800a003e' Input past end of file ... Check if directory and file exists, if not create...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found