libtcod / python-tcod

A high-performance Python port of libtcod. Includes the libtcodpy module for backwards compatibility with older projects.
BSD 2-Clause "Simplified" License
409 stars 36 forks source link

Installation failed on Windows 10 #35

Closed nightblade9 closed 6 years ago

nightblade9 commented 6 years ago

I installed TDL on Windows 10 by running pip install tdl from an elevated (administrator) command-prompt. This is necessary because I installed for all users, and presumably my current user doesn't have access to change C:\ProgramFiles\WhereverPythonLives.

After that, when I execute import tdl from Python 3.6.4, I get this error:

File "C:\Users\me\Code\furusiya\furusiya\io\adapters\tdl_adapter.py", line 2, in <module>
    import tdl
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\tdl\__init__.py", line 65, in <module>
    from tcod import ffi as _ffi
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\tcod\__init__.py", line 20, in <module>
    from tcod.libtcodpy import *
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\tcod\libtcodpy.py", line 10, in <module>
    from tcod.libtcod import *
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\tcod\libtcod.py", line 87, in <module>
    from tcod._libtcod import lib, ffi
ImportError: DLL load failed: The specified module could not be found.

Any idea what I'm doing wrong? I have a fresh install of Python 3.6.4, I didn't install anything other than TDL yet.

HexDecimal commented 6 years ago

ImportError: DLL load failed: The specified module could not be found.

This error usually means that the SDL2.dll file bundled with tdl wasn't found (should be at site-packages\tcod\x86\SDL2.dll on your install.)

I wasn't able to reproduce your issue even while replicating your exact environment (fresh install of Python3.6.4-32 for all users, installing tdl via elevated pip prompt.)

nightblade9 commented 6 years ago

There seems to be something strange about that particular machine. I can't reproduce it on other Windows VMs.

I'll close this for now and re-open it if it reoccurs on another machine. Sorry about that.

nightblade9 commented 6 years ago

I checked that the file is there (it is). I tried granting All Users full access, but the same error repeated. I uninstalled and reinstalled it (granting full access to all users to the Python root installation directory), but I get the same error.

If you have any other ideas, I would like to hear them. I fear this is something generic to my Python installation on Windows 10, rather than a TDL issue (sorry). To be sure, I tried importing the other packages (numpy, pip, setuptools, cffi, and pycparser) and I can import them just fine.

I'm going to try uninstalling and installing the 64-bit version of Python instead.

nightblade9 commented 6 years ago

Reinstalling the 64-bit version of Python, with the same caveats, resulted in the same behaviour.

Any ideas?

HexDecimal commented 6 years ago

I just tested tdl on a real Windows 10 computer and it loaded without issues.

Dependency Walker might give you more specific information on what modules are missing if you run it on tcod\_libtcod.pyd

nightblade9 commented 6 years ago

@HexDecimal maybe you can help me validate my installation; how did you install Python, and how did you install TDL?

nightblade9 commented 6 years ago

Looks like a lot of API-MS-WIN-* transitive dependencies are missing. Here's a very small subset sample from one dependency in Dependency Walker.

image

HexDecimal commented 6 years ago

I guess you might need the Visual C++ Redistributables, I thought they were included in Python, but I must have been wrong.

nightblade9 commented 6 years ago

I installed the 2017 64-bit distributable from here (found via Google) and it works now.

Thanks so much for your help with this!