Tilengine - The 2D retro graphics engine forum

Full Version: OSError[126]?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I recently downloaded the binaries from itch.io and even got sdl2/pysdl2 to work (I think that's needed).  I want to code using tilengine with python on a Windows 10 (x64) computer.

But here's my Problem: when I'm trying to import the module, there's an error that says that there's no module named 'tilengine'.
I even know why: I didn't install tilengine or at least, python doesn't know that the module even exists on my computer.

Then I tried to import it while in the tilengine\samples\python folder and also in the tilengine\bindings\python folder, because those are the two folders where tilengine.py is located.

There, I got another error:

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tilengine
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "C:\Development\Tilengine_windows_x64\bindings\python\tilengine.py", line 271, in <module>
   _tln = cdll.LoadLibrary("Tilengine.dll")
 File "C:\Development\Python\Python37\lib\ctypes\__init__.py", line 434, in LoadLibrary
   return self._dlltype(name)
 File "C:\Development\Python\Python37\lib\ctypes\__init__.py", line 356, in __init__
   self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

This is the point where I dont know what to do next and I got no Idea what the problem even is.
Does anybody know how to move on?

Greetings, Sam.

P.S: Could you also tell me how to install tilengine so I don't have to put my code in the samples folder? At this point I only have the folder structure from itch.io copied into my development folder in C:\ and I don't think that's right.

Edit: I'm rather new to coding, so sorry if my question is kinda stupid, should've mentioned that.
Hello and welcome Sam Smile

I see you've downloaded Windows binaries. Windows is picky in the sense that it doesn't provide a standard folder to put shared components, so it's up to the end user to manage it, or an invasive installer that modifies the path environment variable must be developed. This is not the case under Linux.

In your case, to have you going quickly: you must copy the files Tilengine.dll, SDL2.dll and Tilengine.py to the same folder where you have your own python test program. Please let me know if it does work now!

I‘m sorry I was not able to answer this for that long, but I’ve been busy a lot lately. Nevertheless thank you for your quick response. It worked great and now I can finally start coding with your engine.