Search code examples
pythonpython-3.xpycharmimporterror

Pycharm Error: DLL load failed while importing qhull: The specified module could not be found


I've been trying to run my code and it throws an Import Error that says DLL load failed while importing qhull: The specified module could not be found.

What could be wrong, and what can I do to fix this


Solution

  • Your question is too generic: there can be many reasons. My easiest and quick way to solve such class of problems (assuming you already checked the environment, and that you have relevant packages):

    • remove all python cache (.pyc files)

    and if this doesn't solve the problem do:

    • copy the setting of your virtual environment (or conda environment)

    • delete the virtual environment (and then move or remove the remaining files)

    • create again the environment, with the packages you got from first point

    Very often, with such procedures, you get again a working environment. It seems that on some updates, some files remain in the wrong place, and so the wrong version of a DLL is used, and it confuse python and windows, about inconsistent status.

    Sometime you may have segmentation fault in Python program, alternate to failed to load DLL error.