Difference between revisions of "Complete Roguelike Tutorial, using Python+libtcod, problems"

From RogueBasin
Jump to navigation Jump to search
m
(Rewrote for up to date information.)
Line 10: Line 10:
If any of the following helps you, please edit the page and add a note about what exactly your problem was.  This will allow us to fold back the information into the tutorial to make it clearer and prevent others from having the difficulties you had.
If any of the following helps you, please edit the page and add a note about what exactly your problem was.  This will allow us to fold back the information into the tutorial to make it clearer and prevent others from having the difficulties you had.


== libtcodpy cannot be found ==
== Python - Windows Error - The specified module could not be found ==


Your project directory, whatever it is called, should contain the following files:
<center>
[[File:Libtcodpy-directory.png]]
</center>
Note:
<ul>
<li>You may have chosen a different name for your tutorial code file, than <code>firstrl.py</code>.</li>
<li>The file sizes may differ from what the version of libtcod that the tutorial is based around, but if you provide a screenshot of this same information yourself, this is valuable information to give us - as it allows us to have a hint at which version of libtcod you are using.</li>
<li>The <code>savegame</code> file is generated, and you will not have that until later in the tutorial.</li>
<li>The <code>libtcodpy</code> directory is the one that comes from the libtcod release you downloaded.</li>
</ul>
=== Where do you execute Python? ===
Python locates files, like <code>libtcodpy</code>, based on both what directory you are executing the Python within, and where your tutorial code is located.  In the screenshot above, you will note that <code>firstrl.py</code> is located in the same directory as both <code>libtcodpy</code> and the dlls <code>SDL2.dll libtcod.dll libtcod-gui.dll</code>.
The safest way to execute Python, if you this is all new to you, is explicitly within the directory the <code>firstrl.py</code> file is located.
<center>
[[File:Libtcodpy-command.png]]
</center>
Note:
<ul>
<ul>
<li>The current directory is that of the tutorial code and libtcod dependencies, in my case <code>C:\Users\rmtew\Documents\xxx\project</code>.  I know that Python when executed, should be able to find these files.</li>
<li>Go to the libtcod release you downloaded and extracted.</li>
<li>The full path of the Python executable <code>c:\Python27\python.exe</code> is given, so that I know that Python 2.7 32-bit is executed.</li>
<li>Run "samples.exe".  Does it run?  If so, then you shouldn't be here..  It is expected that you should see a message about "vcruntime140.dll" being missingIt is likely that this is the reason your Python code can't load the dlls.</li>
<li>Install the <a href="https://www.microsoft.com/en-us/download/details.aspx?id=53587">Visual Studio 2015 runtime</a> from Microsoft.</li>
<li>Try running "samples.exe" again.  It should work now.  And your Python script should run now.</li>
</ul>
</ul>



Revision as of 08:37, 2 February 2017

This is part of a series of tutorials; the main page can be found here.


Problems

If any of the following helps you, please edit the page and add a note about what exactly your problem was. This will allow us to fold back the information into the tutorial to make it clearer and prevent others from having the difficulties you had.

Python - Windows Error - The specified module could not be found

  • Go to the libtcod release you downloaded and extracted.
  • Run "samples.exe". Does it run? If so, then you shouldn't be here.. It is expected that you should see a message about "vcruntime140.dll" being missing. It is likely that this is the reason your Python code can't load the dlls.
  • Install the <a href="https://www.microsoft.com/en-us/download/details.aspx?id=53587">Visual Studio 2015 runtime</a> from Microsoft.
  • Try running "samples.exe" again. It should work now. And your Python script should run now.

Problems Solved

Please add copy the section below, and fill it out. Thanks!

YOUR NAME HERE

YOUR NOTE ON WHAT YOU DID DIFFERENTLY THAT REQUIRED YOU TO COME TO THIS PAGE, AND WHAT ON THIS PAGE HELPED YOU.