Issue with Python install

Posted by Noname on Sun 13 Aug 2023 03:56 AM — 5 posts, 11,676 views.

#0
I am getting a 'Class not registered' issue.


Error -2147221164 occurred when loading scripting engine:

Class not registered 


I use anaconda. Here are the steps that I followed:

1. Create a new environment that uses 32bit python 2.7 and activated it

2. pip install pywin32 and did the post install script

3. Registered using the axscript

I have tried all combinations of running the post install script and axscript with user and admin privileges, with my default python and with the 2.7 python executables, outside of virtual environments.

I also tried to run mushclient from the environment that I created, but mushclient would close suddenly every time I loaded a world file.

I just can't seem to get python scripting working.

Any suggestions? Thank you.
Australia Forum Administrator #1
Search this forum for 2147221164.

There are a few posts about it, mainly it seems that Python scripting was not properly installed.

We haven't had many queries about that recently, so I'm not sure what to suggest.

You could try switching to Lua for scripting. It's another interpreted language, not that dissimilar to Python (except that indenting is not important).

Lua support is inbuilt in the client.

Instead of dicts and lists, Lua has tables, which perform a very similar function.
#2
I appreciate the response.

Playing a MUD right now isn't critical for me; I just wanted a project to practice Python. I will probably just focus on SCPI programming for my instruments at work instead.

I have found the dlls that pywin32 produces and I've shoved them in various directories, like system32 and so on. I even tried re-registering every dll, huge mistake! Currently my anaconda install is just a base environment and I've tried their packaged pywin32. Although, the issue could be that the base install is not 32bit interpreter, however you'd probably have to use a new environment for the 32bit anyway. Still get the same CLSID error, despite finding it in regedit and setting whatever paths there are to the correct path. I still have some ideas that I could try, but ran out of motivation.

I thought I'd mention what I've tried so far, just in case anybody else still struggles with this issue.
Australia Forum Administrator #3
If you want to play with Python, you could just do it stand-alone. I've been doing that recently. You can do graphics and all sorts of cool stuff with it.
#4
I messed around with this problem here and there when I had time and I finally got it working.


Roughly here are the steps that I followed:
1. Installed the latest version of Anaconda 64bit

2. Created a 32bit python environment:
- Make sure to install the conda package in this environment

3. While in the 32bit environment, follow the instructions for installing pywin32 from https://pypi.org/project/pywin32/
- Run the post install script with admin permissions so that it will write to the sysWOW64 or whatever system folder

4. You can check the regedit entry for {DF630910-1C1D-11d0-AE36-8C0F5E000000} to make sure that it has the path for those pywin32 libraries (sysWOW64 or whatever from step 3)

5. Get the path to the 32bit python environment folder, you can type where python while in the 32bit python environment to get the path

6. While in the 32bit python environment, type set PYTHONHOME=<the path that you got from step 5>

7. Within the folder that you find in step 5, there will be a Lib\site-packages folder, copy the full path to that folder

8. While in the 32bit python environment, type set PYTHONPATH=<the path that you got from step 7>

9. While in the 32bit python environment, go to your mushclient directory and type conda run mushclient.exe


I feel like my steps and explanation may be hard to follow. If there is anybody that is trying this method and having issues, then post a question in this thread and I'll try to help out.