Repository: evennia/evennia

Issue:
[BUG] Fresh Evennia install on Windows gives TypeError on --init
#### Brief summary of issue / Description of requested feature:
After having installed Evennia, and trying to initialize it with `evennia --init mygame`, it fails and gives the error:
`TypeError: _getfullpathname: path should be string, bytes or os.PathLike, not NoneType`

#### Steps to reproduce the issue / Reasons for adding feature:

1. Install Evennia with the latest Python (3.10, but also gives error on 3.7) on Windows
2. Arrive at `evennia --init mygame`

#### Error output / Expected result of feature
```
Traceback (most recent call last):
  File "D:\muddev\evenv\Scripts\evennia_launcher.py", line 16, in <module>
    from evennia.server.evennia_launcher import main
  File "D:\muddev\evennia\evennia\server\evennia_launcher.py", line 41, in <module>
    EVENNIA_LIB = os.path.join(os.path.dirname(os.path.abspath(evennia.__file__)))
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ntpath.py", line 566, in abspath
    return normpath(_getfullpathname(path))
TypeError: _getfullpathname: path should be string, bytes or os.PathLike, not NoneType
```

#### Extra information, such as Evennia revision/repo/branch, operating system and ideas for how to solve / implement:
Python 3.10
Windows 10 Home
Evennia 0.9.5


Discussion:
Python 3.10 is not supported for Evennia 0.9.5. Are you really sure this also happens for 3.7?
I just uninstalled Python 3.10 and installed Python 3.7 again to once more check whether it also happens for 3.7, and it does.
Ok, thanks for verifying. Not sure why you'd get that. :/ 
Odd. It also has nothing to do with my PATH environment for Python as that's set already.
Having the same issue on a fresh install on Windows 10. Noticed that the Git pull was pulling the 0.9.5 version not 1.0, so manually downloaded 1.0, tried a clean install and got the error again. Also tried clearing powershell, activating and deactivating the venv. Still get the error and can't continue the install / setup. Only have Python 3.10 installed and pathed to it in Windows with no issues using other python apps.
I had this same problem after attempting to use Python 3.10. Subsequently I installed Python 3.7 and ensured my system was defaulting to 3.7 with 'python -V'. I uninstalled and reinstalled the virtualenv, deleted the evennia source and the entire muddev directory and started afresh using Windows Powershell as an administrator. I am now stuck with this error when trying to init: 

```Traceback (most recent call last):
  File "C:\muddev\evenv\Scripts\evennia_launcher.py", line 16, in <module>
    from evennia.server.evennia_launcher import main
  File "C:\muddev\evennia\evennia\server\evennia_launcher.py", line 1245, in <module>
    EVENNIA_VERSION = evennia_version()
  File "C:\muddev\evennia\evennia\server\evennia_launcher.py", line 1228, in evennia_version
    version = evennia.__version__
AttributeError: module 'evennia' has no attribute '__version__'```
Temporary solution found ThePyromancer23#1684 on discord which worked for me too on python 3.10, dev 1.0, but should work(tm) on other setups(anything with win), if you are getting the same error in same place :
In _your directory with evennia/evenv_ \evennia\evennia\server change these 2 lines in evennia_launcher.py :
Line 42 change to `EVENNIA_LIB = r"C:\\install\\path\\your_muddev_folder\\evennia\\evennia"`
Line 1246 change to `EVENNIA_VERSION = "develop"` or "1.0-dev" , any string should do

After this, the command ran, but did not test anything after it, will do tommorow. More similar errors clould maybe be fixed by force returning the value that is expected
Fix for fix : in case something looks up the version by the command, it is better to edit the evennia_version() (above the var) to return the string, and leave the var to get the version from it
Completed the install and ran the example game, seems to work


Resolving patch:
diff --git a/evennia/server/evennia_launcher.py b/evennia/server/evennia_launcher.py
--- a/evennia/server/evennia_launcher.py
+++ b/evennia/server/evennia_launcher.py
@@ -38,7 +38,7 @@
 
 import evennia  # noqa
 
-EVENNIA_LIB = os.path.join(os.path.dirname(os.path.abspath(evennia.__file__)))
+EVENNIA_LIB = os.path.join(EVENNIA_ROOT, "evennia")
 EVENNIA_SERVER = os.path.join(EVENNIA_LIB, "server")
 EVENNIA_TEMPLATE = os.path.join(EVENNIA_LIB, "game_template")
 EVENNIA_PROFILING = os.path.join(EVENNIA_SERVER, "profiling")
@@ -1227,7 +1227,7 @@ def evennia_version():
     version = "Unknown"
     try:
         version = evennia.__version__
-    except ImportError:
+    except (ImportError, AttributeError):
         # even if evennia is not found, we should not crash here.
         pass
     try:


Test patch: