Hello,
I want to use an new library i downloaded e.g. chilkat library (http://www.chilkatsoft.com/python.asp), how do i do that ?

I tried to put on the beginning of my code:

__path__ = ["dir_with_chilkat_pyd"] 
require chilkat

but does'nt work.

What i want to run:

Dani AI

Generated

Short expert note: the traceback you posted (ImportError: DLL load failed) is not a Python-language problem but a native loader problem — the Python wrapper tried to load a compiled Chilkat extension and Windows could not find a required native DLL. Typical causes are a mismatch between the Chilkat binary and the running Python (version or 32/64 bit), a missing Visual C++ runtime, or a vendor DLL that isn’t on PATH. Chilkat’s own notes point users to the Python module-search/compiled-module documentation for this class of error. (cknotes.com)

Actionable checklist (work top-to-bottom):

  • Make sure the Chilkat binary you downloaded was built for the exact Python you run (same major/minor and same 32/64-bit). Official Windows builds for older Pythons were compiled with specific MSVC toolsets. (pywavelets.readthedocs.io)
  • Install the matching Visual C++ runtime if it’s missing (extensions built with MSVC need the corresponding CRT). For example, MSVC 2008-built extensions expect the VC++ 2008 runtime (MSVCR90) to be present. (learn.microsoft.com)
  • Use a dependency-inspection tool to open the compiled module and find which DLLs cannot be loaded (modern “Dependencies” or the older Dependency Walker). That will show the exact DLL names you need to provide or install. (github.com)
  • If the binary is correct and runtimes are installed, put the package where Python actually searches (site-packages or the vendor installer) — as others suggested, path placement matters but the DLL-load error usually means a native dependency is still missing.

If the dependency tool lists specific missing DLLs, include those names when asking for help or contact Chilkat support; the missing DLL names make the root cause obvious. (cknotes.com)

Recommended Answers

All 9 Replies

try

import chilkat

no does'nt work, i put all stuff in "C:\Python26\Lib".

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import chilkat
  File "C:\Python26\lib\chilkat.py", line 19, in <module>
    _chilkat = swig_import_helper()
  File "C:\Python26\lib\chilkat.py", line 15, in swig_import_helper
    _mod = imp.load_module('_chilkat', fp, pathname, description)
ImportError: DLL load failed: The specified module could not be found.

a _name module is usually a swig/boost C/C++ library. Here try to see if there's a in the downloaded archive and use python build and python install.

hi leegao,
no setup in there :(

That means you haven't installed/setup the module correctly. Why don't you try going to the source website and see if there are instructions for setup.

I did,
that where the only instructions:

1.
__path__ = ["dir_with_chilkat_pyd"]
2.
require chilkat

hmm nobody an idea?

Well if you install it manually, you need to put it into the C:\Python2X\Lib\site-packages directory in its own folder. Then in that site-packages folder, make a file called chilkat.pth, and in it, write only chilkat (which is the name of the folder for it in the site-packages directory). Hopefully after this, if you start up the interpreter and type import chilkat it should import like any other module.

I haven't ever used chilkat, but this is the generic way to install a regular package, if it doesn't come with its own setup.

Get the absolute path of the package and add it onto the python path

say abs_dir = '/root/downloads/package-name/'

Then at the start of your script, you need to do the following

from sys import path as PYTHONPATH
PYTHONPATH.append('/root/downloads/package-name')

If you're on windows, don't forget the escape the backslashes

(IE: when you see \, you need to change it to \\)

Alternatively you can just place it inside a folder that's already in the python path (IE: the python25 directory). If you're on Linux, try using whereis python25 and then place the package folder inside there, if you're on windows, just go with C:\Python25\

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.