From 2f2dada10bebfc235cef745135276972569c0c7b Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Nov 2022 18:36:47 +0100 Subject: [PATCH] Update install instructions for Windows --- docs/source/Setup/Installation-Troubleshooting.md | 1 + docs/source/Setup/Installation.md | 2 ++ evennia/__main__.py | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/source/Setup/Installation-Troubleshooting.md b/docs/source/Setup/Installation-Troubleshooting.md index d84e61ee26..8741c7fa60 100644 --- a/docs/source/Setup/Installation-Troubleshooting.md +++ b/docs/source/Setup/Installation-Troubleshooting.md @@ -83,6 +83,7 @@ If `localhost` doesn't work when trying to connect to your local game, try `127. ## Windows Troubleshooting +- If you install with `pip install evennia` and find that the `evennia` command is not available, run `py -m evennia` once. This should add the evennia binary to your environment. If this fails, make sure you are using a [virtualenv](Installation-Git#virtualenv). Worst case, you can keep using `py -m evennia` in the places where the `evennia` command is used. - Install Python [from the Python homepage](https://www.python.org/downloads/windows/). You will need to be a Windows Administrator to install packages. - When installing Python, make sure to check-mark *all* install options, especially the one about making Python available on the path (you may have to scroll to see it). This allows you to just write `python` in any console without first finding where the `python` program actually sits on your hard drive. diff --git a/docs/source/Setup/Installation.md b/docs/source/Setup/Installation.md index c2401138bd..45116948b5 100644 --- a/docs/source/Setup/Installation.md +++ b/docs/source/Setup/Installation.md @@ -31,6 +31,8 @@ Once installed, make sure the `evennia` command works. Use `evennia -h` for usag ## Initialize a new game +> Windows users: You need to first run `python -m evennia` once. This should permanently add the evennia launcher to your environment, making the `evennia` command available. + Use `cd` to enter a folder where you want to do your game development. Here (and in the rest of the Evennia documentation) we call this folder `mygame`, but you should of course name your game whatever you like. diff --git a/evennia/__main__.py b/evennia/__main__.py index af7f9fa00c..56e98e8138 100644 --- a/evennia/__main__.py +++ b/evennia/__main__.py @@ -8,7 +8,7 @@ Notably, this should work also if evennia is installed with pip but the executable is not on the path (so the plain `evennia` command doesn't work). -For windows, this will try to inject the evennia launcher into the executable path +For Windows, this will try to inject the evennia launcher into the executable path to make the `evennia` command available. """ @@ -40,13 +40,16 @@ main() try: with open(pyscript_path, "w") as fil: fil.write(pyscript) + print(f"... Created launcher {pyscript_path}.") except FileNotFoundError: print("Failed to add evennia_launcher.py to {pyscript_path}.") if not os.path.exists(batfile_path): try: with open(batfile_path, "w") as fil: fil.write(batfile) + print(f"... Created batfile {batfile_path}.") except FileNotFoundError: print("Failed to add evennia.bat to {batfile_path}.") +# forward to the evennia launcher itself main()