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

Enable running on Windows #1192

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ai2thor/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def lock_sh(self):
class ExternalBuild(object):
def __init__(self, executable_path):
self.executable_path = executable_path
external_system_platforms = dict(Linux=Linux64, Darwin=OSXIntel64)
external_system_platforms = dict(Linux=Linux64, Darwin=OSXIntel64, Windows=StandaloneWindows64)
self.platform = external_system_platforms[platform.system()]

# assuming that an external build supports both server types
Expand Down
4 changes: 2 additions & 2 deletions ai2thor/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,8 +1166,8 @@ def _start_unity_thread(self, env, width, height, server_params, image_name):
if self.server.unity_proc.returncode is not None:
message = (
"Unity process has exited - check "
"~/.config/unity3d/Allen\ Institute\ for\ "
"Artificial\ Intelligence/AI2-THOR/Player.log for errors. "
"~/.config/unity3d/Allen\\ Institute\\ for\\ "
"Artificial\\ Intelligence/AI2-THOR/Player.log for errors. "
"Confirm that Vulkan is properly configured on this system "
"using vulkaninfo from the vulkan-utils package. returncode=%s"
% (self.server.unity_proc.returncode,)
Expand Down
10 changes: 9 additions & 1 deletion ai2thor/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,15 @@ class WebGL(BasePlatform):
class StandaloneWindows64(BasePlatform):
@classmethod
def executable_path(cls, base_dir, name):
return os.path.join(base_dir, name)
# can't run executable without the .exe extension on Windows
path = os.path.join(base_dir, name + ".exe")
# Flip the slashes to avoid losing them during the call to the
# Unity executable
return path.replace("\\", "/")

@classmethod
def old_executable_path(cls, base_dir, name):
return cls.executable_path(base_dir, name)

def select_platforms(request):
candidates = []
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
author_email="[email protected]",
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
install_requires=[
"flask",
"numpy",
"pyyaml",
"requests",
Expand All @@ -53,7 +52,11 @@
"Pillow",
"python-xlib",
"opencv-python",
"werkzeug>=0.15.0", # needed for unix socket support
# last versions where TCP keepalive is enabled in the development server,
# required the WsgiServer to work properly
# see https://werkzeug.palletsprojects.com/en/2.3.x/changes/#version-2-1-2
"flask==2.1.3",
"werkzeug==2.1.1"
],
setup_requires=["pytest-runner"],
tests_require=["pytest", "pytest-timeout", "pytest-cov", "jsonschema", "shapely", "pytest-mock", "dictdiffer"],
Expand Down