Mohamed Nasr Mohamed Nasr - 1 month ago 15
Python Question

win8.1 64 bit + python 2.7.3 + import htql; ImportError: DLL load failed: The specified module could not be found

This is the first time to use python and need to import htql

when i run this code:

import htql;
page="<a href=a.html>1</a><a href=b.html>2</a><a href=c.html>3</a>";
query="<a>:href,tx";
for url, text in htql.HTQL(page, query):
print(url, text);


i got the following error:

import htql; ImportError: DLL load failed: The specified module could not be found.
error screenshot

i trys to to solve error as refered here ImportError: DLL load failed: The specified module could not be found

BUT error still exists!!

Also i am Installing the Visual C++ Redistributable für Visual Studio 2015 from this links: https://www.microsoft.com/de-at/download/details.aspx?id=48145
to fix the missing DLLs

BUT error still exists!

Please help!

THNAKS IN ADVANCE ..

Answer

The problem of the questioner is he followed installation instructions from HTQL PDF-manual named Hyper-Text Query Language COM Interface, which obviously describes library setup for COM (Component Object Model by Microsoft), proposing regsvr32 <path-to-dll>. Intended to be used within win32-infrastructure aware applications first place

While there are means to use COM from within python (e.g. via pywin32 and others), it's not common method python script expects.

Proper solution is to follow instructions from HTQL home page, suggesting:

Windows binaries: Download the htql.zip and extract "htql.pyd" to the Python's DLLs directory, such as in 'C:\Python27\DLLs\' or 'C:\Python32\DLLs\'.

to install precompiled python .pyd module within python libraries search path

Comments