[Fixed]-Python Sass unable to load DLL

1👍

You should just install the appropriate wheel from: https://pypi.python.org/pypi/libsass (libsass-0.8.3-cp34-none-win_amd64.whl)

👤Ringil

0👍

I just experienced a similar error:

      File "K:\Python27\lib\site-packages\sass.py", line 26, in <module>
      from _sass import OUTPUT_STYLES, compile_filename, compile_string
      ImportError: DLL load failed: The specified module could not be found.

After a bunch of searching, it looked like on Windows I was missing the needed C++, and again, being Windows, the simplest way to fix this was to update VisualStudio with the C++ library.

Error is gone and libsass is working great after doing this.

    Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit(Intel)] on win32  Type "help", "copyright", "credits" or "license" for more information.
    >>> import sass
    >>> print sass.compile(string='a { b{ color: blue; } }')
     a b { color: blue; }

I know it doesn’t directly answer the question, but thought I’d leave the solution I found here, for those who are in the process of losing a couple hours like I did.

I had Visual Studio 2013 – installed Visual Studio Community 2015 (making sure to select the C & C++ libraries)

👤KateJ

0👍

The libsass DLL (“_sass.pyd” in the python world) probably misses some of its dependencies.

You can just install the small “Visual C++ Redistributable for Visual Studio 2015” to get that bunch of missing C++ components.

Leave a comment