Search code examples
pandasnumpydependenciescommandline

Unable to import required dependencies, Python with Pandas and Numpy


I think this question has been asked before on the internet, but the proposed solutions have so far not worked.

I am trying to run a script that imports numpy and pandas. When I run using the Python Console in my IDE (PyCharm), everything works fine. However, when I run the script from the command line, the following error is displayed:

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

and

Unable to import required dependencies

I am using Anaconda Navigator. There my Pandas and Numpy are listed. I tried to uninstall them via the conda shell (conda uninstall numpy, conda uninstall pandas) and then install them again, but without result.

Hope anyone can help.


Solution

  • After trial and error, I de-installed Anaconda and installed pip instead. Then I installed the modules using pip, and it worked like a charm.

    (Not the most elegant answer since it does not explain why things went wrong in the first place, but it offered a workable solution at least.)